{ "swagger": "2.0", "info": { "version": "2.0.0", "title": "Semantic API", "description": "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).\n\nThe Semantic API uses concepts which are, by definition, terms in The New York Times controlled vocabulary. Like the way facets are used in the Articles API, concepts are a good way to uncover articles of interest in The New York Times archive, and at the same time, limit the scope and number of those articles. The Semantic API maps to external semantic data resources, in a fashion consistent with the idea of linked data. The Semantic API also provides combination and relationship information to other, similar concepts in The New York Times controlled vocabulary.\n", "logo": { "url": "img/logo_api_semantic_150x150.png" } }, "host": "api.nytimes.com", "schemes": [ "http", "https" ], "basePath": "\/svc\/semantic\/v2\/concept", "produces": [ "application\/json" ], "security": [ { "apikey": [ ] } ], "paths": { "\/name\/{concept-type}\/{specific-concept}.json": { "get": { "parameters": [ { "name": "concept-type", "in": "path", "description": "The type of the concept, used for Constructing a Semantic API Request by Concept Type and Specific Concept Name. The parameter is defined as a name-value pair, as in \"concept_type=[nytd_geo|nytd_per|nytd_org|nytd_des]\".\n", "type": "string", "enum": [ "nytd_geo", "nytd_per", "nytd_org", "nytd_des" ], "required": true }, { "name": "specific-concept", "in": "path", "description": "The name of the concept, used for Constructing a Semantic API Request by Concept Type and Specific Concept Name. The parameter is defined in the URI path, as the element immediately preceding \".json\" like with \"Baseball.json\".\n", "required": true, "type": "string" }, { "name": "fields", "in": "query", "description": "\"all\" or comma-separated list of specific optional fields: pages, ticker_symbol, links, taxonomy, combinations, geocodes, article_list, scope_notes, search_api_query\n\nOptional fields are returned in result_set. They are briefly explained here:\n\npages: A list of topic pages associated with a specific concept.\nticker_symbol: If this concept is a publicly traded company, this field contains the ticker symbol.\nlinks: A list of links from this concept to external data resources.\ntaxonomy: For descriptor concepts, this field returns a list of taxonomic relations to other concepts.\ncombinations: For descriptor concepts, this field returns a list of the specific meanings tis concept takes on when combined with other concepts.\ngeocodes: For geographic concepts, the full GIS record from geonames.\narticle_list: A list of up to 10 articles associated with this concept.\nscope_notes: Scope notes contains clarifications and meaning definitions that explicate the relationship between the concept and an article.\nsearch_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.\n", "required": false, "type": "string", "enum": [ "all", "pages", "ticker_symbol", "links", "taxonomy", "combinations", "geocodes", "article_list", "scope_notes", "search_api_query" ] }, { "name": "query", "in": "query", "description": "Precedes the search term string. Used in a Search Query. Except for <specific_concept_name>, Search Query will take the required parameters listed above (<concept_type>, <concept_uri>, <article_uri>) as an optional_parameter in addition to the query=<query_term>.", "required": true, "type": "string" } ], "responses": { "200": { "description": "An array of Concepts", "schema": { "type": "object", "properties": { "status": { "type": "string" }, "copyright": { "type": "string" }, "num_results": { "type": "integer" }, "results": { "type": "array", "items": { "$ref": "#\/definitions\/Concept" } } } } } } } }, "\/search.json": { "get": { "parameters": [ { "name": "query", "in": "query", "description": "Precedes the search term string. Used in a Search Query. Except for <specific_concept_name>, Search Query will take the required parameters listed above (<concept_type>, <concept_uri>, <article_uri>) as an optional_parameter in addition to the query=<query_term>.", "required": true, "type": "string" }, { "name": "offset", "in": "query", "description": "Integer value for the index count from the first concept to the last concept, sorted alphabetically. Used in a Search Query. A Search Query will return up to 10 concepts in its results.", "default": 10, "required": false, "type": "integer" }, { "name": "fields", "in": "query", "description": "\"all\" or comma-separated list of specific optional fields: pages, ticker_symbol, links, taxonomy, combinations, geocodes, article_list, scope_notes, search_api_query\n\nOptional fields are returned in result_set. They are briefly explained here:\n\npages: A list of topic pages associated with a specific concept.\nticker_symbol: If this concept is a publicly traded company, this field contains the ticker symbol.\nlinks: A list of links from this concept to external data resources.\ntaxonomy: For descriptor concepts, this field returns a list of taxonomic relations to other concepts.\ncombinations: For descriptor concepts, this field returns a list of the specific meanings tis concept takes on when combined with other concepts.\ngeocodes: For geographic concepts, the full GIS record from geonames.\narticle_list: A list of up to 10 articles associated with this concept.\nscope_notes: Scope notes contains clarifications and meaning definitions that explicate the relationship between the concept and an article.\nsearch_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.\n", "required": false, "type": "string", "enum": [ "all", "pages", "ticker_symbol", "links", "taxonomy", "combinations", "geocodes", "article_list", "scope_notes", "search_api_query" ] } ], "responses": { "200": { "description": "An array of Concepts", "schema": { "type": "object", "properties": { "status": { "type": "string" }, "copyright": { "type": "string" }, "num_results": { "type": "integer" }, "results": { "type": "array", "items": { "$ref": "#\/definitions\/ConceptRelation" } } } } } } } } }, "definitions": { "Concept": { "type": "object", "properties": { "concept_id": { "type": "integer" }, "concept_name": { "type": "string" }, "is_times_tag": { "type": "integer" }, "concept_status": { "type": "string" }, "vernacular": { "type": "string" }, "concept_type": { "type": "string" }, "concept_created": { "type": "string" }, "concept_updated": { "type": "string" }, "taxonomy": { "type": "array", "items": { "type": "object", "properties": { "source_concept_id": { "type": "integer" }, "target_concept_id": { "type": "integer" }, "source_concept_name": { "type": "string" }, "target_concept_name": { "type": "string" }, "source_concept_type": { "type": "string" }, "target_concept_type": { "type": "string" }, "source_concept_vernacular": { "type": "string" }, "target_concept_vernacular": { "type": "string" }, "taxonomic_relation": { "type": "string" }, "taxonomic_verification_status": { "type": "string" } } } }, "links": { "type": "array", "items": { "type": "object", "properties": { "concept_id": { "type": "integer" }, "concept_name": { "type": "string" }, "concept_status": { "type": "string" }, "is_times_tag": { "type": "integer" }, "concept_type": { "type": "string" }, "link_id": { "type": "integer" }, "relation": { "type": "string" }, "link": { "type": "string" }, "link_type": { "type": "string" }, "mapping_type": { "type": "string" } } } }, "search_api_query": { "type": "string" }, "article_list": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "body": { "type": "string" }, "byline": { "type": "string" }, "concepts": { "type": "object", "properties": { "nytd_des": { "type": "array", "items": { "type": "string" } }, "nytd_org": { "type": "array", "items": { "type": "string" } }, "nytd_per": { "type": "array", "items": { "type": "string" } } } }, "date": { "type": "string" }, "document_type": { "type": "string" }, "title": { "type": "string" }, "type_of_material": { "type": "string" }, "url": { "type": "string" } } } }, "total": { "type": "integer" } } }, "scope_notes": { "type": "array", "items": { "type": "object", "properties": { "scope_note": { "type": "string" }, "scope_note_name": { "type": "string" }, "scope_note_type": { "type": "string" } } } }, "combinations": { "type": "array", "items": { "type": "object", "properties": { "combination_source_concept_id": { "type": "integer" }, "combination_source_concept_name": { "type": "string" }, "combination_source_concept_type": { "type": "string" }, "combination_target_concept_id": { "type": "integer" }, "combination_target_concept_name": { "type": "string" }, "combination_target_concept_type": { "type": "string" }, "combination_note": { "type": "string" } } } }, "ancestors": { "type": "array", "items": { "$ref": "#\/definitions\/ConceptRelation" } }, "descendants": { "type": "array", "items": { "$ref": "#\/definitions\/ConceptRelation" } } } }, "ConceptRelation": { "type": "object", "properties": { "concept_id": { "type": "integer" }, "concept_name": { "type": "string" }, "is_times_tag": { "type": "integer" }, "concept_status": { "type": "string" }, "vernacular": { "type": "string" }, "concept_type": { "type": "string" }, "concept_created": { "type": "string" }, "concept_updated": { "type": "string" } } } }, "securityDefinitions": { "apikey": { "type": "apiKey", "name": "api-key", "in": "query" } } }