New: the Crawl API. A whole website in one job, priced before it starts. See how it works
Playground Sign in Start free
Government, public data and academic · clinicaltrials.gov

How to scrape ClinicalTrials.gov

ClinicalTrials.gov is a website with public pages available for scraping. Developers typically collect data from its public pages.

Ujeebu scrapes any public website. Not listed here? Try any URL in the Playground or ask us about a site.

Working 5 credits a page, about $0.50 per 1,000 on Pro

7 of 7 of our checks passed in the last 7 days (100%).

Last check 2026-12-03 23:02 UTC · last pass 2026-12-03 23:02 UTC · checked with our own requests, never customer data.

Try it in the Playground

Markdown API one call

ClinicalTrials.gov pages as Markdown with the Markdown API

5 credits a page
  • markdown
  • fit_markdown
  • markdown_with_citations
  • references
  • metadata
curl -G 'https://api.ujeebu.com/markdown' \
  -H "ApiKey: $UJEEBU_API_KEY" \
  --data-urlencode 'url=https://clinicaltrials.gov/study/NCT04280705' \
  --data-urlencode 'js=true'

Send any ClinicalTrials.gov page: a report, a notice, a press release or a guidance page. The answer is JSON with the page as Markdown, headings, lists, tables and links kept, ready for an LLM or a search index. PDF files are not converted. Successful responses cost credits; blocked, timed-out and failed requests are free.

Run the code on this page with your own key: 5,000 free credits for 21 days, no card. Get a free API key →

ClinicalTrials.gov pages as Markdown: the Markdown API

What you want from clinicaltrials.gov is usually the text of a page: a report, a notice, a press release, a guidance page. The Markdown API fetches the page and returns it as clean Markdown, with the headings, lists, tables and links kept and the navigation dropped, for an LLM, a search index or a diff between versions.

One call: GET /markdown 5 credits a page

curl -G 'https://api.ujeebu.com/markdown' \
  -H "ApiKey: $UJEEBU_API_KEY" \
  --data-urlencode 'url=https://clinicaltrials.gov/study/NCT04280705' \
  --data-urlencode 'js=true'

The Ujb-Credits header gives the cost. filter=raw keeps the whole page, filter=bm25 with a query keeps the passages about it. PDF files are not converted: send HTML pages. Try it in the Playground

What the answer holds

FieldTypeExample
markdowntextFor general information about clinical research, read Learn About Studies(https://clinicaltrials.gov/study-basics/learn-...
fit_markdowntextFor general information about clinical research, read Learn About Studies(https://clinicaltrials.gov/study-basics/learn-...
markdown_with_citationstextFor general information about clinical research, read Learn About Studies(https://clinicaltrials.gov/study-basics/learn-...
referencestext## References [1]: /policy#data-element-definitions "Data Element Definitions" [2]: /policy/results-definitions#DelayRes...
metadata.markdown_lengthnumber36112
metadata.html_lengthnumber553465
metadata.filtertextfit
urlURLhttps://clinicaltrials.gov/study/NCT04280705

Sample output (real call on 2026-12-03, trimmed)

{
    "success": true,
    "url": "https://clinicaltrials.gov/study/NCT04280705",
    "markdown": "For general information about clinical research, read Learn About Studies(https://clinicaltrials.gov/study-basics/learn-about-studies).\n\nClinicalTrials.gov is a website and online database of clinical research studies and information about their results. The National Library of Medicine (NLM) maintains the website. **The study sponsor or investigator submits information** about their study to ClinicalTrials.gov and **is responsible for the safety, science, and accuracy** of any study they list.\n\nBefore joining a study, talk to your health care professional about possible risks and benefits. To learn more about taking part in studies, read\n\n## Adaptive COVID-19 Treatment Trial (ACTT)\n\n**Compl...",
    "fit_markdown": "For general information about clinical research, read Learn About Studies(https://clinicaltrials.gov/study-basics/learn-about-studies).\n\nClinicalTrials.gov is a website and online database of clinical research studies and information about their results. The National Library of Medicine (NLM) maintains the website. **The study sponsor or investigator submits information** about their study to ClinicalTrials.gov and **is responsible for the safety, science, and accuracy** of any study they list.\n\nBefore joining a study, talk to your health care professional about possible risks and benefits. To learn more about taking part in studies, read\n\n## Adaptive COVID-19 Treatment Trial (ACTT)\n\n**Compl...",
    "markdown_with_citations": "For general information about clinical research, read Learn About Studies(https://clinicaltrials.gov/study-basics/learn-about-studies).\n\nClinicalTrials.gov is a website and online database of clinical research studies and information about their results. The National Library of Medicine (NLM) maintains the website. **The study sponsor or investigator submits information** about their study to ClinicalTrials.gov and **is responsible for the safety, science, and accuracy** of any study they list.\n\nBefore joining a study, talk to your health care professional about possible risks and benefits. To learn more about taking part in studies, read\n\n## Adaptive COVID-19 Treatment Trial (ACTT)\n\n**Compl...",
    "references": "\n\n## References\n\n[1]: /policy#data-element-definitions \"Data Element Definitions\"\n[2]: /policy/results-definitions#DelayResultsType \"Delay Results Type\"\n[3]: https://www.fda.gov/news-events/expanded-access/expanded-access-information-patien...",
    "metadata": {
        "conversion_time_ms": 256,
        "filter": "fit",
        "html_length": 553465,
        "markdown_length": 36112
    }
}

Code

Complete scripts: set the UJEEBU_API_KEY environment variable and run them as they are. Each one makes the call above and prints the main fields of the answer, and prints the credits the request cost (the Ujb-Credits response header) on stderr. A non-200 answer stops the script with the API's error message.

ClinicalTrials.gov pages (Markdown API)

One page: prints the length and the start of its Markdown. No SDK has a Markdown call yet, so these scripts call the API directly.

clinicaltrials_markdown.py pip install requests
# Get a ClinicalTrials.gov page as Markdown with the Ujeebu Markdown API.
# GET /markdown with the page URL: the API answers JSON with the page as Markdown (markdown, fit_markdown), the same text with numbered citations and the metadata.
# Run: UJEEBU_API_KEY=your_key python3 clinicaltrials_markdown.py   (pip install requests)

import json
import os
import sys

import requests

API_URL = "https://api.ujeebu.com/markdown"
API_KEY = os.environ.get("UJEEBU_API_KEY")
PARAMS = {
    "url": "https://clinicaltrials.gov/study/NCT04280705",
    "js": "true",
}

if not API_KEY:
    sys.exit("Set the UJEEBU_API_KEY environment variable.")

try:
    response = requests.get(API_URL, headers={"ApiKey": API_KEY}, params=PARAMS, timeout=180)
except requests.RequestException as error:
    sys.exit(f"Request failed: {error}")
if response.status_code != 200:
    try:
        message = response.json().get("message", response.text)
    except ValueError:
        message = response.text
    sys.exit(f"HTTP {response.status_code}: {str(message)[:300]}")
print(f"Ujb-Credits: {response.headers.get('Ujb-Credits')}", file=sys.stderr)
data = response.json()
markdown = data.get("fit_markdown") or data.get("markdown") or ""
print(f"{len(markdown)} characters of Markdown", file=sys.stderr)
print(markdown[:2000])
# every field: print(json.dumps(data, indent=2, ensure_ascii=False))

SDK tabs use the official Ujeebu SDKs (ujeebu-python 0.1.5, @ujeebu-org/ujeebu-sdk 0.1.2, github.com/ujeebu/ujeebu-go v0.1.8); there is no PHP SDK, so the PHP tab calls the API with curl. For agents and scripts, the same status and settings are at /scrape/clinicaltrials.json.

Try it yourself

Run this on ClinicalTrials.gov with your own key

Get a free API key, set UJEEBU_API_KEY and run any script above as it is. 5,000 free credits for 21 days, no card.

Settings that work today

From our health checks over the last 7 days: the cheapest settings that return the real page most of the time.

Endpoint/markdown
jstrue
Costup to 30 credits a request (only HTTP 200 and 404 are billed; blocked, timed-out and failed requests are free)

Each public page is one request: change the path in the URL to fetch another one. Our checks run with JavaScript rendering on (js=true): keep it on.

Try it in the Playground

What people build with ClinicalTrials.gov data

  • Research datasetsBuild datasets of public pages for analysis, search or LLM pipelines.More on this use case

Limits and etiquette

  • Public pages only. Pages behind a login, and data shown only to signed-in users, are out of scope.
  • Keep the rate modest: fetch pages one after another or with low concurrency, and cache what you already have.
  • robots.txt of clinicaltrials.gov (read 2026-12-03): public pages allowed for generic crawlers; crawl delay 1 s.
  • Read ClinicalTrials.gov's terms of service before you collect data at scale, and do not collect personal data you have no basis to process. This guide is not legal advice.

Questions

Can you scrape ClinicalTrials.gov with Ujeebu?

Yes. 7 of 7 checks of public ClinicalTrials.gov pages passed in the last 7 days with the settings on this page.

Which settings work for ClinicalTrials.gov?

Call /markdown with js=true.

How many credits does a ClinicalTrials.gov request cost?

With these settings a request costs up to 30 credits. Only responses with HTTP 200 or 404 are billed: a blocked or timed-out request is free.

How do I get ClinicalTrials.gov pages as clean text for an LLM?

Send the page URL to the Markdown API (GET /markdown?url=<page>). It returns the page as Markdown with its headings, lists, tables and links, without the navigation and boilerplate, plus the same text with numbered citations: 5 credits a page, no rules to write. PDF files are not converted. Only successful responses are billed.

Is it allowed to scrape ClinicalTrials.gov?

Its robots.txt allows generic crawlers on the page types in this guide. It asks for 1 seconds between requests. Collect public pages only, read ClinicalTrials.gov's terms of service, keep your request rate modest and do not collect personal data you have no basis to process. This is not legal advice.

How fresh is this page?

The status and settings come from our own health checks of clinicaltrials.gov, which run around the clock. Last check: 2026-12-03 23:02:43 UTC; last pass: 2026-12-03 23:02:43 UTC.