semantics | R Documentation |
The Semantic API complements the Articles API. With the Semantic API, you get access to the long list of people, places, organizations and other locations, entities and descriptors that make up the controlled vocabulary used as metadata by The New York Times (sometimes referred to as Times Tags and used for Times Topics pages.
ny_semantic_search(q, pages = 1, fields = "all")
ny_semantic_concept(
concept,
q = NULL,
type = c("nytd_geo", "nytd_per", "nytd_org", "nytd_des"),
fields = "all"
)
q |
Precedes the search term string. Used in a Search Query. Except for |
pages |
Number of pages of results to collect. |
fields |
|
concept |
The name of the concept, used for Constructing a Semantic API Request by Concept Type and Specific Concept Name, i.e.: |
type |
The type of the concept, used for Constructing a Semantic API Request by Concept Type and Specific Concept Name. |
Valid values for the fields
argument and they explanation.
all
- All values.
pages
- A list of topic pages associated with a specific concept.
ticker_symbol
- If this concept is a publicly traded company, this field contains the ticker symbol.
links
- A list of links from this concept to external data resources.
taxonomy
- For descriptor concepts, this field returns a list of taxonomic relations to other concepts.
combinations
- For descriptor concepts, this field returns a list of the specific meanings tis concept takes on when combined with other concepts.
geocodes
- For geographic concepts, the full GIS record from geonames.
article_list
- A list of up to 10 articles associated with this concept.
scope_notes
- Scope notes contains clarifications and meaning definitions that explicate the relationship between the concept and an article.
search_api_query
- Returns the request one would need to submit to the Article Search API to obtain a list of articles annotated with this concept.
## Not run:
nytimes_key("xXXxxXxXxXXx")
war <- ny_semantic_search("war")
war <- ny_semantic_concept("baseball", type = "nytd_des")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.