### GET /entity/autocomplete/ Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Searches for biomedical entities by name and returns their standardized PubTator identifiers. ```APIDOC ## GET /entity/autocomplete/ ### Description Searches for biomedical entities by name and returns their standardized PubTator identifiers. Use this endpoint to convert free-text entity names into PubTator IDs. ### Method GET ### Endpoint https://www.ncbi.nlm.nih.gov/research/pubtator3-api/entity/autocomplete/ ### Parameters #### Query Parameters - **query** (string) - Required - The entity name to search for. - **limit** (integer) - Optional - The maximum number of results to return. ``` -------------------------------- ### GET /research/pubtator3-api/entity/autocomplete/ Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Retrieves associated entity IDs for a given bioconcept entity name. ```APIDOC ## GET /research/pubtator3-api/entity/autocomplete/ ### Description Given an entity, return its associated entity IDs. ### Method GET ### Endpoint /research/pubtator3-api/entity/autocomplete/ ### Parameters #### Query Parameters - **query** (string) - Required - The free text query representing the bioconcept entity name to search for. - **limit** (integer) - Optional - Limit for the number of suggestions returned (default: 10) ### Response #### Success Response (200) - **response** (object) - Successful response with the entity identifier. ``` -------------------------------- ### GET /research/pubtator3-api/search/ Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Retrieves relevant PubMed articles using entity IDs or free text queries. ```APIDOC ## GET /research/pubtator3-api/search/ ### Description Retrieve relevant PubMed articles using entityId or free texts. ### Method GET ### Endpoint /research/pubtator3-api/search/ ### Parameters #### Query Parameters - **text** (string) - Required - Query text in format: relations:{relation}|{entityID_1}|{entityID_2} - **page** (integer) - Optional - Page number (default: 1) ### Response #### Success Response (200) - **response** (object) - Successful response with search results. ``` -------------------------------- ### GET /relations Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Finds related entities based on a specific entity ID and relation type. ```APIDOC ## GET /relations ### Description Finds related entities based on a specific entity ID and relation type. Supports multiple entity types and various biomedical relation types. ### Method GET ### Endpoint https://www.ncbi.nlm.nih.gov/research/pubtator3-api/relations ### Parameters #### Query Parameters - **e1** (string) - Required - The source entity ID. - **e2** (string) - Required - The target entity type or ID. - **type** (string) - Required - The relation type (e.g., treat, cause, interact, associate, inhibit, stimulate). - **limit** (integer) - Optional - The maximum number of results to return. ``` -------------------------------- ### GET /search/ Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Retrieves PubMed article IDs (PMIDs) that mention a specific relationship between two entities. ```APIDOC ## GET /search/ ### Description Retrieves PubMed article IDs (PMIDs) that mention a specific relationship between two entities for evidence verification. ### Method GET ### Endpoint https://www.ncbi.nlm.nih.gov/research/pubtator3-api/search/ ### Parameters #### Query Parameters - **text** (string) - Required - The search query string formatted as relations:type|entity1|entity2. - **page** (integer) - Optional - The page number for paginated results. ``` -------------------------------- ### GET /research/pubtator3-api/relations Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Searches for top-5 related entities based on a specific entity ID and relation type. ```APIDOC ## GET /research/pubtator3-api/relations ### Description Search top-5 related entities based on a specific entityId and relation type. ### Method GET ### Endpoint /research/pubtator3-api/relations ### Parameters #### Query Parameters - **e1** (string) - Required - The given entity ID starting with @. - **e2** (string) - Required - The selected return type from all responses (chemical, disease, gene, variant). - **type** (string) - Required - The given relation type (treat, cause, cotreat, convert, compare, interact, associate, positive_correlate, negative_correlate, prevent, inhibit, stimulate, drug_interact). - **limit** (integer) - Optional - Limit for the number of suggestions returned (default: 10) ### Response #### Success Response (200) - **response** (object) - Successful response with related entities. ``` -------------------------------- ### GET /research/pubtator3-api/relations Source: https://github.com/ncbi-nlp/pubtator-gpt/blob/main/README.md Search for top related entities based on a specific entity ID and a defined relation type. ```APIDOC ## GET /research/pubtator3-api/relations ### Description Search top-5 related entities based on a specific entityId and an optional relation type. ### Method GET ### Endpoint /research/pubtator3-api/relations ### Parameters #### Query Parameters - **e1** (string) - Required - The given entity ID, which must be annotated by PubTator starting with the character @. - **e2** (string) - Required - The selected return type from all responses (chemical, disease, gene, variant). - **type** (string) - Required - The given relation type (treat, cause, cotreat, convert, compare, interact, associate, positive_correlate, negative_correlate, prevent, inhibit, stimulate, drug_interact). - **limit** (integer) - Optional - Limit for the number of suggestions returned (default: 10). ### Response #### Success Response (200) - **relations** (array) - List of related entities. #### Response Example { "relations": [ { "entity_id": "string", "relation_type": "string", "details": {} } ] } ``` -------------------------------- ### Configure GPT System Instructions Source: https://github.com/ncbi-nlp/pubtator-gpt/blob/main/README.md Use these instructions in the GPT configuration to define the workflow for calling PubTator 3.0 APIs and summarizing results. ```text You are a helpful assistant. Your task is to give a complete answer to user's questions with the API of Pubtator 3.0. Do these steps: - Step 1: You should call the FindEntityID API by asking the question "What are the entity ID of {the given entity name} in PubTator?" Please show the response content of this API to users. - Step 2: You should call the FindRelatedEntity API by asking the question "What are the PubTator IDs (starting with @) of related {a specific entity type} that have {specific relation type} to {specific PubTator entity ID with @}?" - Step 3: You should call the SearchPubTatorID API by asking the question "What are PMIDs mention the {relation type} between {first PubTator ID (starting with @)} and {second PubTator ID (starting with @)}?" - Step 4: Check if all related PubTator IDs obtained in Step 2 are finished to search for PMIDs through Step 3. If not, return Step 3. If yes, proceed to Step 5. - Step 5: Summarize and return results. Each answer should contain an entity, a short description in one sentence and no more than three PMIDs as the evidence. Each PMID should link to its PubMed article (marked as "PubMed") and PubTator article (marked as "PubTator") at the same time. You should also check all answers carefully and exclude the rough answers such as "@DISEASE_Drug_Related_Side_Effects_and_Adverse_Reactions" and "@DISEASE_Chemical_and_Drug_Induced_Liver_Injury". After checking, you can only select 4 most related entities as answer if there are rough answers, otherwise, return all related entities as the response. Rules: - You can decompose the user question into questions that can be solved by the available APIs. - You can use these APIs through function calls and summarize their answers to give the final answer. - If you have finished this task, you should start a message with "Summary:" to summarize the conversation. - For each answer in the results, you also should cite the correct PMIDs and give the accessible link as the evidence. - Do not make any hallucinations. Instructions for PubTator GPT Actions: - Step 1. Tell the user you are searching for the standard entity ID of the given entity name by calling the FindEntityID api. Given the output, proceed Step 2. - Step 2. Tell the user you are finding the related entities for the entity ID obtained in Step 1 under a specific relation type extracted from the question. This step needs to call the FindRelatedEntity api. Proceed to Step 3. - Step 3.  Tell the user you are searching for the article IDs that contain both the given entity name and the related entity by calling the SearchPubTatorID api. Given the output, proceed Step 4. - Step 4. Check if all related entities obtained in Step 2 are finished to search for PubTator articles. If not, return Step 3. If yes, summarize the final results and cite the PMIDs. REQUIRED_ACTIONS: - Action: FindEntityID Confirmation Link: https://www.ncbi.nlm.nih.gov/research/pubtator3-api/entity/autocomplete/ - Action: FindRelatedEntity Confirmation Link: https://www.ncbi.nlm.nih.gov/research/pubtator3-api/relations - Action: SearchPubTatorID Confirmation Link: https://www.ncbi.nlm.nih.gov/research/pubtator3-api/search/ ``` -------------------------------- ### PubTator GPT Instructions Source: https://github.com/ncbi-nlp/pubtator-gpt/blob/main/README.md Instructions for the GPT to interact with PubTator 3.0 APIs. ```APIDOC ## GPT Instructions for PubTator 3.0 ### Description This GPT is designed to answer user questions by utilizing the PubTator 3.0 API. It follows a step-by-step process to find entity IDs, related entities, and relevant PubMed articles. ### Steps 1. **FindEntityID**: Call the `FindEntityID` API to get the entity ID for a given entity name. Display the API response to the user. 2. **FindRelatedEntity**: Call the `FindRelatedEntity` API to find related entities based on entity type and relation type, using the entity ID from Step 1. 3. **SearchPubTatorID**: Call the `SearchPubTatorID` API to find PMIDs that mention the relationship between two PubTator IDs obtained in Step 2. 4. **Check and Iterate**: Verify if all related entities from Step 2 have been searched for PMIDs in Step 3. If not, repeat Step 3. If yes, proceed to Step 5. 5. **Summarize and Format**: Summarize the results, including an entity, a one-sentence description, and up to three PMIDs as evidence. Each PMID should link to its PubMed and PubTator articles. Exclude rough answers and select the most relevant entities. ### Rules - Decompose user questions into solvable API calls. - Use function calls to interact with APIs and summarize responses. - Start the final summary message with "Summary:". - Cite correct PMIDs with accessible links for evidence. - Avoid hallucinations. ### PubTator GPT Actions 1. **FindEntityID**: Inform the user about searching for the entity ID using the `FindEntityID` API. Proceed to Step 2 with the output. 2. **FindRelatedEntity**: Inform the user about finding related entities using the `FindRelatedEntity` API. Proceed to Step 3. 3. **SearchPubTatorID**: Inform the user about searching for articles using the `SearchPubTatorID` API. Proceed to Step 4 with the output. 4. **Final Summary**: Check if all related entities have been processed. If yes, summarize the results and cite PMIDs. ``` -------------------------------- ### Define OpenAPI Schema for PubTator Actions Source: https://github.com/ncbi-nlp/pubtator-gpt/blob/main/README.md Paste this schema into the GPT Actions configuration to enable communication with the NCBI PubTator API endpoints. ```json { "openapi": "3.1.0", "info": { "title": "NCBI PubTator APIs", "description": "External NCBI APIs to search entity identifiers, related entities and PubMed articles.", "version": "v1.0.0" }, "servers": [ { "url": "https://www.ncbi.nlm.nih.gov" } ], "paths": { "/research/pubtator3-api/entity/autocomplete/": { "get": { "summary": "Given an entity, return its associated entity IDs. Please note that some of the returned entities might not be the exact input entity and ignore them.", "operationId": "FindEntityID", "parameters": [ { "name": "query", "in": "query", "description": "The free text query representing the bioconcept entity name to search for.", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "description": "Limit for the number of suggestions returned", "schema": { "type": "integer", "default": 10 } ``` -------------------------------- ### Complete PubTator GPT Actions OpenAPI Schema Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt This JSON schema defines the OpenAPI 3.1.0 specification for the NCBI PubTator APIs. It includes details for entity autocompletion, related entity search, and PubMed article search endpoints, enabling custom GPT action configurations. ```json { "openapi": "3.1.0", "info": { "title": "NCBI PubTator APIs", "description": "External NCBI APIs to search entity identifiers, related entities and PubMed articles.", "version": "v1.0.0" }, "servers": [ { "url": "https://www.ncbi.nlm.nih.gov" } ], "paths": { "/research/pubtator3-api/entity/autocomplete/": { "get": { "summary": "Given an entity, return its associated entity IDs.", "operationId": "FindEntityID", "parameters": [ { "name": "query", "in": "query", "description": "The free text query representing the bioconcept entity name to search for.", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "description": "Limit for the number of suggestions returned", "schema": { "type": "integer", "default": 10 } } ], "responses": { "200": { "description": "Successful response with the entity identifier." }, "400": { "description": "Bad request, possibly due to missing or incorrect query parameter." }, "404": { "description": "Bioconcept not found." } } } }, "/research/pubtator3-api/relations": { "get": { "summary": "Search top-5 related entities based on a specific entityId and relation type.", "operationId": "FindRelatedEntity", "parameters": [ { "name": "e1", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The given entity ID starting with @." }, { "name": "e2", "in": "query", "required": true, "schema": { "type": "string", "enum": ["chemical", "disease", "gene", "variant"] }, "description": "The selected return type from all responses" }, { "name": "type", "in": "query", "required": true, "schema": { "type": "string", "enum": ["treat", "cause", "cotreat", "convert", "compare", "interact", "associate", "positive_correlate", "negative_correlate", "prevent", "inhibit", "stimulate", "drug_interact"] }, "description": "The given relation type." }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 10 } } ], "responses": { "200": { "description": "Successful response with related entities." }, "400": { "description": "Bad request." }, "404": { "description": "Entity or relation type not found." } } } }, "/research/pubtator3-api/search/": { "get": { "summary": "Retrieve relevant PubMed articles using entityId or free texts.", "operationId": "SearchPubTatorID", "parameters": [ { "name": "text", "in": "query", "required": true, "description": "Query text in format: relations:{relation}|{entityID_1}|{entityID_2}", "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "default": 1 } } ], "responses": { "200": { "description": "Successful response with search results." }, "400": { "description": "Bad request, invalid input parameters." } } } } } } ``` -------------------------------- ### Discover Entity Relationships with PubTator 3.0 API Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Utilize the relations endpoint to find relationships between entities, specifying entity IDs and relation types. This supports various entity types (chemical, disease, gene, variant) and relation types (treat, cause, interact, etc.). ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/relations?e1=@CHEMICAL_Aspirin&e2=disease&type=treat&limit=10" ``` ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/relations?e1=@DISEASE_Liver_Injury&e2=chemical&type=cause&limit=10" ``` ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/relations?e1=@CHEMICAL_Doxorubicin&e2=gene&type=interact&limit=5" ``` ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/relations?e1=@GENE_TP53&e2=chemical&type=inhibit&limit=10" ``` -------------------------------- ### PubTator 3.0 API Schema Source: https://github.com/ncbi-nlp/pubtator-gpt/blob/main/README.md OpenAPI schema for the NCBI PubTator APIs, including endpoints for entity lookup, relation search, and article search. ```APIDOC ## NCBI PubTator APIs ### Description External NCBI APIs to search entity identifiers, related entities and PubMed articles. ### Base URL `https://www.ncbi.nlm.nih.gov` ### Endpoints #### 1. FindEntityID ##### Summary Given an entity, return its associated entity IDs. Please note that some of the returned entities might not be the exact input entity and ignore them. ##### Method `GET` ##### Endpoint `/research/pubtator3-api/entity/autocomplete/` ##### Query Parameters - **query** (string) - Required - The free text query representing the bioconcept entity name to search for. - **limit** (integer) - Optional - Limit for the number of suggestions returned. Default: 10. #### 2. FindRelatedEntity ##### Summary Given a PubTator entity ID, return its related entities under a specific relation type. ##### Method `GET` ##### Endpoint `/research/pubtator3-api/relations` ##### Query Parameters - **entityID** (string) - Required - The PubTator entity ID (e.g., @12345). - **relationType** (string) - Required - The type of relation to search for (e.g., interacts_with). - **limit** (integer) - Optional - Limit for the number of suggestions returned. Default: 10. #### 3. SearchPubTatorID ##### Summary Given two PubTator entity IDs, return the PMIDs that mention the relation between them. ##### Method `GET` ##### Endpoint `/research/pubtator3-api/search/` ##### Query Parameters - **entity1** (string) - Required - The first PubTator entity ID (e.g., @12345). - **entity2** (string) - Required - The second PubTator entity ID (e.g., @67890). - **relationType** (string) - Optional - The type of relation to search for. If not provided, all relations between the entities will be returned. - **limit** (integer) - Optional - Limit for the number of suggestions returned. Default: 10. ### Error Handling - Standard HTTP error codes will be returned for invalid requests or server errors. ``` -------------------------------- ### Search PubMed Articles by Relation with PubTator 3.0 API Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Employ the search endpoint to retrieve PubMed article IDs (PMIDs) for specific entity relationships. The results can be used to link to PubMed and PubTator for evidence verification. ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/search/?text=relations:treat|@CHEMICAL_Doxorubicin|@DISEASE_Neoplasms&page=1" ``` ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/search/?text=relations:treat|@CHEMICAL_Aspirin|@DISEASE_Cardiovascular_Diseases&page=1" ``` ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/search/?text=relations:associate|@GENE_BRCA1|@DISEASE_Breast_Neoplasms&page=1" ``` -------------------------------- ### Find Entity IDs with PubTator 3.0 API Source: https://context7.com/ncbi-nlp/pubtator-gpt/llms.txt Use the entity autocomplete endpoint to search for biomedical entities by name and retrieve their standardized PubTator identifiers. This is useful for converting free-text names into IDs required by other PubTator API endpoints. ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/entity/autocomplete/?query=aspirin&limit=5" ``` ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/entity/autocomplete/?query=diabetes&limit=10" ``` ```bash curl -X GET "https://www.ncbi.nlm.nih.gov/research/pubtator3-api/entity/autocomplete/?query=BRCA1&limit=5" ``` -------------------------------- ### Query Relations API Source: https://github.com/ncbi-nlp/pubtator-gpt/blob/main/README.md This endpoint allows you to query for relations between entities. You can specify the relation type and the IDs of the two entities involved. Pagination is supported. ```APIDOC ## POST /query/relations ### Description Queries for relations between entities based on provided criteria. ### Method POST ### Endpoint /query/relations ### Parameters #### Query Parameters - **page** (integer) - Optional - Page number for pagination. Defaults to 1. #### Request Body - **relations** (string) - Required - Query text in the format: relations:{relation}|{entityID_1}|{entityID_2}. Example: relations:treat|@CHEMICAL_Doxorubicin|@DISEASE_Neoplasms ### Request Example ```json { "relations": "relations:treat|@CHEMICAL_Doxorubicin|@DISEASE_Neoplasms" } ``` ### Response #### Success Response (200) - **results** (array) - An array of relation objects. - **entityId** (string) - The ID of the first entity. - **entityName** (string) - The name of the first entity. - **relationType** (string) - The type of relation. - **relatedEntityId** (string) - The ID of the second entity. - **relatedEntityName** (string) - The name of the second entity. #### Response Example ```json { "results": [ { "entityId": "@CHEMICAL_Doxorubicin", "entityName": "Doxorubicin", "relationType": "treat", "relatedEntityId": "@DISEASE_Neoplasms", "relatedEntityName": "Neoplasms" } ] } ``` #### Error Responses - **400** - Bad request, invalid input parameters. - **500** - Internal server error. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.