{"files":{"SKILL.md":"---\nname: opentrials-api\ndescription: \"OpenTrials API skill. Use when working with OpenTrials for search, trials, publications. Covers 17 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# OpenTrials API\nAPI version: 0.0.1\n\n## Auth\nNo authentication required.\n\n## Base URL\nNot specified.\n\n## Setup\n1. No auth setup needed\n2. GET /search -- returns trials based on a search query. by default, it'll search in all of a trial's attributes.\n3. Explore available endpoints below\n\n## Endpoints\n17 endpoints across 11 groups. See references/api-spec.lap for full details.\n\n### Search\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /search | Returns trials based on a search query. By default, it'll search in all of a trial's attributes. |\n| GET | /search/autocomplete/{in} | Autocomplete search feature for supported database entities (`location`). It has the same options as a regular `search` operation, with an extra **required** `in` parameter indicating the entity type to search. |\n| GET | /search/fda_documents | Search the FDA documents |\n\n### Trials\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /trials/{id} | Returns a trial's details and related entities (e.g. `conditions`). |\n| GET | /trials/{id}/records | Returns a trial's raw records from its sources |\n| GET | /trials/{trialId}/records/{id} | Returns a trial's raw record from its sources |\n\n### Publications\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /publications/{id} | Returns publication details |\n\n### Conditions\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /conditions/{id} | Returns condition details |\n\n### Organisations\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /organisations/{id} | Returns organisation details |\n\n### Persons\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /persons/{id} | Returns person details |\n\n### Interventions\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /interventions/{id} | Returns intervention details |\n\n### Sources\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /sources | Returns list of sources |\n\n### Fda_applications\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /fda_applications | Returns FDA applications |\n| GET | /fda_applications/{id} | Returns an FDA application details |\n\n### Documents\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /documents | Returns documents |\n| GET | /documents/{id} | Returns details of a document |\n\n### Document_categories\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /document_categories | Returns document categories |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"Search search?\" -> GET /search\n- \"Get autocomplete details?\" -> GET /search/autocomplete/{in}\n- \"Search fda_documents?\" -> GET /search/fda_documents\n- \"Get trial details?\" -> GET /trials/{id}\n- \"Get publication details?\" -> GET /publications/{id}\n- \"Get condition details?\" -> GET /conditions/{id}\n- \"Get organisation details?\" -> GET /organisations/{id}\n- \"List all records?\" -> GET /trials/{id}/records\n- \"Get record details?\" -> GET /trials/{trialId}/records/{id}\n- \"Get person details?\" -> GET /persons/{id}\n- \"Get intervention details?\" -> GET /interventions/{id}\n- \"List all sources?\" -> GET /sources\n- \"List all fda_applications?\" -> GET /fda_applications\n- \"Get fda_application details?\" -> GET /fda_applications/{id}\n- \"List all documents?\" -> GET /documents\n- \"Get document details?\" -> GET /documents/{id}\n- \"List all document_categories?\" -> GET /document_categories\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Paginated endpoints accept limit/offset or cursor parameters\n- Error responses include status codes and descriptions in the spec\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api OpenTrials API\n@version 0.0.1\n@endpoints 17\n@toc search(3), trials(3), publications(1), conditions(1), organisations(1), persons(1), interventions(1), sources(1), fda_applications(2), documents(2), document_categories(1)\n\n@group search\n@endpoint GET /search\n@desc Returns trials based on a search query. By default, it'll search in all of a trial's attributes.\n@optional {q: any # The search query (follows the [ElasticSearch Query String](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/query-dsl-query-string-query.html#query-string-syntax) syntax), page: any # The page number, per_page: any # Number of items per page}\n@returns(200) Success\n\n@endpoint GET /search/autocomplete/{in}\n@desc Autocomplete search feature for supported database entities (`location`). It has the same options as a regular `search` operation, with an extra **required** `in` parameter indicating the entity type to search.\n@required {in: any # The entity to search for}\n@optional {q: any # The search query, page: any # The page number, per_page: any # Number of items per page}\n@returns(200) Success\n\n@endpoint GET /search/fda_documents\n@desc Search the FDA documents\n@optional {q: any # The search query (follows the [ElasticSearch Query String](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/query-dsl-query-string-query.html#query-string-syntax) syntax), text: any # Search query on the documents file's text (follows the [ElasticSearch Simple Query String](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/query-dsl-simple-query-string-query.html#_simple_query_string_syntax) syntax), page: any # The page number, per_page: any # Number of items per page}\n@returns(200) Success\n\n@endgroup\n\n@group trials\n@endpoint GET /trials/{id}\n@desc Returns a trial's details and related entities (e.g. `conditions`).\n@required {id: any # ID of the trial}\n@returns(200) Success\n@errors {404: Trial not found}\n\n@endgroup\n\n@group publications\n@endpoint GET /publications/{id}\n@desc Returns publication details\n@required {id: any # ID of the publication}\n@returns(200) Success\n@errors {404: Publication not found}\n\n@endgroup\n\n@group conditions\n@endpoint GET /conditions/{id}\n@desc Returns condition details\n@required {id: any # ID of the condition}\n@returns(200) Success\n@errors {404: Condition not found}\n\n@endgroup\n\n@group organisations\n@endpoint GET /organisations/{id}\n@desc Returns organisation details\n@required {id: any # ID of the organisation}\n@returns(200) Success\n@errors {404: Organisation not found}\n\n@endgroup\n\n@group trials\n@endpoint GET /trials/{id}/records\n@desc Returns a trial's raw records from its sources\n@required {id: any # ID of the trial}\n@returns(200) Success\n@errors {404: Trial not found}\n\n@endpoint GET /trials/{trialId}/records/{id}\n@desc Returns a trial's raw record from its sources\n@required {trialId: any # ID of the trial, id: any # ID of the trial's record}\n@returns(200) Success\n@errors {404: Trial not found}\n\n@endgroup\n\n@group persons\n@endpoint GET /persons/{id}\n@desc Returns person details\n@required {id: any # ID of the person}\n@returns(200) Success\n@errors {404: Person not found}\n\n@endgroup\n\n@group interventions\n@endpoint GET /interventions/{id}\n@desc Returns intervention details\n@required {id: any # ID of the intervention}\n@returns(200) Success\n@errors {404: Intervention not found}\n\n@endgroup\n\n@group sources\n@endpoint GET /sources\n@desc Returns list of sources\n@returns(200) Success\n\n@endgroup\n\n@group fda_applications\n@endpoint GET /fda_applications\n@desc Returns FDA applications\n@optional {page: any # The page number, per_page: any # Number of items per page}\n@returns(200) Success\n\n@endpoint GET /fda_applications/{id}\n@desc Returns an FDA application details\n@required {id: any # ID of the FDA application}\n@returns(200) Success\n@errors {404: FDA application not found}\n\n@endgroup\n\n@group documents\n@endpoint GET /documents\n@desc Returns documents\n@optional {page: any # The page number, per_page: any # Number of items per page}\n@returns(200) Success\n\n@endpoint GET /documents/{id}\n@desc Returns details of a document\n@required {id: any # ID of the document}\n@returns(200) Success\n@errors {404: Document not found}\n\n@endgroup\n\n@group document_categories\n@endpoint GET /document_categories\n@desc Returns document categories\n@returns(200) Success\n\n@endgroup\n\n@end\n"}}