canonical: https://jentic.com/apis/opentrials.local/opentrials

# OpenTrials API

OpenTrials API provides programmatic access to a database of clinical trial records, supporting documents, FDA applications, conditions, interventions, organisations, persons, and publications. Endpoints cover free-text and faceted search, autocomplete suggestions, FDA document search, and direct lookup of trials and their record provenance. The API is read-only with no authentication required, and is intended for transparency, research, and aggregation use cases that build on top of clinical trial registries.

## For AI agents

Search clinical trials, FDA applications, and supporting documents, and look up trials, conditions, interventions, organisations, and persons by ID.

## Scope

Does not handle trial registration, patient enrollment, or adverse-event reporting - use for read-only OpenTrials search and lookup only.

## Capabilities

- Run full-text search across trials, documents, and FDA applications via /search
- Autocomplete trial-related entities with `/search/autocomplete/{in}`
- Search FDA application documents via `/search/fda_documents`
- Retrieve a specific trial by ID with `/trials/{id}` and inspect its source records
- Look up conditions, interventions, organisations, persons, and publications by ID
- List FDA applications and inspect a single application's records
- Enumerate the data sources contributing to the database with /sources

## Use cases

### Clinical Trial Discovery

Researchers and journalists investigating a drug or condition can run /search with filters to surface every registered trial and supporting document available in OpenTrials. Each trial returned exposes its source registries, intervention list, and condition list, along with `/trials/{id}/records` linking back to the underlying registry entries. This is useful for systematic review preparation and for spotting trial registration mismatches across registries.

Example prompt: GET /search with q='metformin diabetes' and inspect each returned trial's `/trials/{id}/records` to gather all registry entries

### FDA Document Lookup

Regulatory analysts and pharma intelligence teams can use `/search/fda_documents` to find FDA review documents, then `/fda_applications/{id}` to fetch the full application record. /documents and `/documents/{id}` expose the cross-referenced supporting documents (protocols, results, statistical analysis plans) that OpenTrials has indexed alongside the application.

Example prompt: GET `/search/fda_documents` with q='ozempic' and resolve the top results to `/fda_applications/{id}` for full application metadata

### Autocomplete in Trial Search UIs

Frontends building a trial search experience can wire `/search/autocomplete/{in}` to provide type-ahead suggestions for conditions, interventions, organisations, or persons. The {in} path parameter selects the entity type to autocomplete against, returning ranked suggestions for the user's partial input. This avoids implementing a separate suggestion index on the consumer side.

Example prompt: GET `/search/autocomplete/conditions`?q=alzhei and return the top 10 matching condition names

### AI Agent Clinical Research Assistant

An AI agent helping a researcher answer 'find all trials of drug X for condition Y' can call OpenTrials through Jentic without writing endpoint URLs. Jentic resolves the agent's intent into the right /search or `/trials/{id}` call, dispatches the request, and returns structured JSON the agent can summarise. Because OpenTrials is unauthenticated, no key handling is needed.

Example prompt: Through Jentic, search 'find clinical trials about a drug', resolve to GET /search, and execute with q='pembrolizumab melanoma'

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/search` | Full-text search across trials and documents |
| GET | `/search/autocomplete/{in}` | Autocomplete suggestions by entity type |
| GET | `/search/fda_documents` | Search FDA application documents |
| GET | `/trials/{id}` | Look up a trial by ID |
| GET | `/trials/{id}/records` | Get source registry records for a trial |
| GET | `/fda_applications/{id}` | Look up an FDA application by ID |
| GET | `/sources` | List contributing data sources |

## Key resources

- **Trials** — Look up trials by ID and inspect their source records.
- **Search** — Full-text and FDA-document search plus autocomplete.
- **FDA Applications** — List and look up FDA application records.
- **Documents** — List and retrieve supporting documents and document categories.
- **Conditions, Interventions, Organisations, Persons, Publications** — Lookup endpoints for each clinical entity type.
- **Sources** — List the registries and data sources contributing to OpenTrials.

## Why Jentic

- **Setup:** Wiring the OpenTrials API by hand means constructing its search queries and paging through trial and FDA application records yourself. Through Jentic you install once, import the OpenTrials API from the API Directory, and your agent calls it directly.
- **Permission scoping:** OpenTrials is read-only search and lookup with no credential, so scoping is by operation: you limit the agent to the operations it needs, such as searching trials or looking up an FDA application, and leave others out unless you want them. Every operation the agent can call is one you chose to allow.
- **Credential handling:** OpenTrials has no auth, so nothing secret is stored for this API. Jentic still dispatches each call through its audited execution path, and no credential ever enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'search clinical trials' or 'look up an FDA application', and Jentic returns the matching OpenTrials operation with its parameter schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **ClinicalTrials.gov API** — U.S. NIH-operated registry that is one of OpenTrials' source registries; use directly for canonical U.S. trial records.
- **Open Targets Platform REST API** — Pair Open Targets target-disease evidence with OpenTrials trial records for the same target or condition.
- **NCBI Datasets API** — NCBI Datasets covers genes and genomes referenced by trials' interventions and conditions.

## FAQ

### What authentication does the OpenTrials API use?

None - the spec defines no security schemes. Read-only requests go out unauthenticated. Through Jentic the calls dispatch directly with no vault entry needed for this API.

### Can I search across multiple registries in one request with the OpenTrials API?

Yes - /search aggregates across all registries OpenTrials has indexed. The /sources endpoint enumerates the contributing registries so you can verify coverage. Each returned trial exposes its underlying source records via `/trials/{id}/records.`

### What are the rate limits for the OpenTrials API?

OpenTrials does not document a fixed rate limit on the public spec. Treat it as a community resource and back off on transient errors. Heavy automated workloads should be run against a local mirror if available.

### How do I look up a trial by ID through Jentic?

Search Jentic for 'look up clinical trial', load the GET `/trials/{id}` schema, and execute with the trial ID. Jentic returns the trial record including the linked `/trials/{id}/records` list of source registry entries.

### Does the OpenTrials API include results data for trials?

Trial result publications and supporting documents are accessed through `/publications/{id}` and `/documents/{id}` respectively. The trial record itself links to these IDs so the consumer can pull results when present in the source registry.

### What's the difference between `/trials/{id}` and `/trials/{id}/records`?

`/trials/{id}` returns the consolidated OpenTrials view of a trial, while `/trials/{id}/records` returns the underlying registry entries (e.g. ClinicalTrials.gov, EUCTR, ISRCTN) that were merged. `/trials/{trialId}/records/{id}` returns one specific source record for audit purposes.

### Can I limit what my agent is allowed to do with the OpenTrials API?

Yes. Because you run Jentic One self-hosted, your own rules decide which OpenTrials operations your agent may call, and the OpenTrials API is read-only with no credential, so scoping is purely by operation. You can allow only the operations the agent needs, such as GET /search or GET `/fda_applications/{id}`, and leave out others like `/trials/{id}/records` or /sources. Every operation the agent can reach is one you chose to permit.
