Skill Tracer
Skills › Scientific Agent Skills › database-lookup › clinicaltrials.md

clinicaltrials.md

106 lines · skills/database-lookup/references/clinicaltrials.md at 5f2bc03

Open on GitHub
1# ClinicalTrials.gov (v2 API)
2

ClinicalTrials.gov (v2 API)

Raw lines 1 to 2
3## Base URL
4```
5https://clinicaltrials.gov/api/v2/
6```
7

Base URL

https://clinicaltrials.gov/api/v2/
Raw lines 3 to 7
8## Auth
9No API key required. Fully public.

Auth

No API key required. Fully public.

Raw lines 8 to 10
11## Key Endpoints

Key Endpoints

Raw lines 11 to 12
13### API version and data freshness
14```
15GET /version
16```
18Check `dataTimestamp` before time-sensitive retrievals to confirm the daily refresh has completed. ClinicalTrials.gov notes that data is generally refreshed Monday through Friday by 9 a.m. ET / 14:00 UTC.
20ClinicalTrials.gov modernized its data ingest on August 26, 2025. For reproducible comparisons against older exports, note that some rich text markup fields and location/geopoint data may differ from the legacy pipeline.

API version and data freshness

GET /version

Check dataTimestamp before time-sensitive retrievals to confirm the daily refresh has completed. ClinicalTrials.gov notes that data is generally refreshed Monday through Friday by 9 a.m. ET / 14:00 UTC.

ClinicalTrials.gov modernized its data ingest on August 26, 2025. For reproducible comparisons against older exports, note that some rich text markup fields and location/geopoint data may differ from the legacy pipeline.

Raw lines 13 to 21
22### Search studies
23```
24GET /studies
25```
27Key parameters:
28- `query.cond` — condition/disease (e.g. `breast cancer`)
29- `query.intr` — intervention/treatment (e.g. `pembrolizumab`)
30- `query.term` — general search terms
31- `query.spons` — sponsor
32- `query.id` — NCT ID
33- `filter.overallStatus` — pipe-delimited: `RECRUITING|COMPLETED|ACTIVE_NOT_RECRUITING|...`
34- `filter.advanced` — Essie expression, e.g. `AREA[Phase]PHASE3`; there is no `filter.phase` parameter
35- `filter.geo` — `distance(lat,lon,dist)` e.g. `distance(38.89,-77.03,50mi)`
36- `fields` — comma-separated field list to reduce payload
37- `sort` — e.g. `LastUpdatePostDate:desc`
38- `pageSize` — results per page (default 10, max 1000)
39- `pageToken` — cursor for next page (from `nextPageToken` in response)
40- `countTotal=true` — include total count
42Example — recruiting Phase 3 breast cancer trials:
43```
44/studies?query.cond=breast+cancer&filter.overallStatus=RECRUITING&filter.advanced=AREA%5BPhase%5DPHASE3&pageSize=5&countTotal=true
45```
47Response structure:
48```json
50 "totalCount": 1234,
51 "studies": [
52 {
53 "protocolSection": {
54 "identificationModule": {"nctId": "NCT05123456", "briefTitle": "..."},
55 "statusModule": {"overallStatus": "RECRUITING"},
56 "designModule": {"phases": ["PHASE3"], "enrollmentInfo": {"count": 500}},
57 "conditionsModule": {"conditions": ["Breast Cancer"]},
58 "eligibilityModule": {"minimumAge": "18 Years", "sex": "ALL"}
59 }
60 }
61 ],
62 "nextPageToken": "CAYQAg"
64```

Search studies

GET /studies

Key parameters:

  • query.cond — condition/disease (e.g. breast cancer)
  • query.intr — intervention/treatment (e.g. pembrolizumab)
  • query.term — general search terms
  • query.spons — sponsor
  • query.id — NCT ID
  • filter.overallStatus — pipe-delimited: RECRUITING|COMPLETED|ACTIVE_NOT_RECRUITING|...
  • filter.advanced — Essie expression, e.g. AREA[Phase]PHASE3; there is no filter.phase parameter
  • filter.geo — distance(lat,lon,dist) e.g. distance(38.89,-77.03,50mi)
  • fields — comma-separated field list to reduce payload
  • sort — e.g. LastUpdatePostDate:desc
  • pageSize — results per page (default 10, max 1000)
  • pageToken — cursor for next page (from nextPageToken in response)
  • countTotal=true — include total count

Example — recruiting Phase 3 breast cancer trials:

/studies?query.cond=breast+cancer&filter.overallStatus=RECRUITING&filter.advanced=AREA%5BPhase%5DPHASE3&pageSize=5&countTotal=true

Response structure:

{
  "totalCount": 1234,
  "studies": [
    {
      "protocolSection": {
        "identificationModule": {"nctId": "NCT05123456", "briefTitle": "..."},
        "statusModule": {"overallStatus": "RECRUITING"},
        "designModule": {"phases": ["PHASE3"], "enrollmentInfo": {"count": 500}},
        "conditionsModule": {"conditions": ["Breast Cancer"]},
        "eligibilityModule": {"minimumAge": "18 Years", "sex": "ALL"}
      }
    }
  ],
  "nextPageToken": "CAYQAg"
}
Raw lines 22 to 65
66### Single study by NCT ID
67```
68GET /studies/{nctId}
69```
70Example: `/studies/NCT05123456`

Single study by NCT ID

GET /studies/{nctId}

Example: /studies/NCT05123456

Raw lines 66 to 71
72### Study count
73```
74GET /studies?query.cond={condition}&filter.overallStatus=RECRUITING&pageSize=1&countTotal=true
75```
77Read `totalCount` from the first response. `/stats/size` accepts no search parameters and reports registry-wide statistics, not a filtered count.

Study count

GET /studies?query.cond={condition}&filter.overallStatus=RECRUITING&pageSize=1&countTotal=true

Read totalCount from the first response. /stats/size accepts no search parameters and reports registry-wide statistics, not a filtered count.

Raw lines 72 to 78
79### Field metadata
80```
81GET /studies/metadata
82```

Field metadata

GET /studies/metadata
Raw lines 79 to 83
84## Pagination
85Uses cursor-based pagination via `pageToken` (NOT numeric offsets). Include `countTotal=true` on first request to get total.

Pagination

Uses cursor-based pagination via pageToken (NOT numeric offsets). Include countTotal=true on first request to get total.

Raw lines 84 to 86
87## Rate Limits
88No API key. Be reasonable — a few requests per second.

Rate Limits

No API key. Be reasonable — a few requests per second.

Raw lines 87 to 89
90## Bulk download
92Prefer the v2 `/studies` API with `pageToken` pagination for programmatic
93retrieval. The former bulk URL `https://clinicaltrials.gov/AllAPIJSON.zip`
94returns **404** and must not be used.
96For a full-registry **XML** dump, use:
98```
99https://clinicaltrials.gov/AllPublicXML.zip
100```
102That path redirects to `https://clinicaltrials.gov/api/legacy/public-xml?format=zip`
103and returns `Content-Type: application/zip` (`ctg-public-xml.zip`). Confirm the
104redirect still yields a zip before large downloads; CSV / pipe-delimited export
105options are documented under ClinicalTrials.gov Data API “Download” pages when
106XML is not appropriate.

Bulk download

Prefer the v2 /studies API with pageToken pagination for programmatic retrieval. The former bulk URL https://clinicaltrials.gov/AllAPIJSON.zip returns 404 and must not be used.

For a full-registry XML dump, use:

https://clinicaltrials.gov/AllPublicXML.zip

That path redirects to https://clinicaltrials.gov/api/legacy/public-xml?format=zip and returns Content-Type: application/zip (ctg-public-xml.zip). Confirm the redirect still yields a zip before large downloads; CSV / pipe-delimited export options are documented under ClinicalTrials.gov Data API “Download” pages when XML is not appropriate.

Raw lines 90 to 106