How to Use OpenFDA to Track CRLs

Image

OpenFDA

The FDA provides an API called OpenFDA, which gives programmatic access to a wide range of information about drugs, devices, and regulatory actions.


Transparency API: Real-Time CRLs

Last week, as part of its Radical Transparency Program, the FDA announced that it will now publish Complete Response Letters (CRLs), right after they are issued.

This is particularly important for investors and analysts, because they no longer need to wait for a trial sponsor to disclose a CRL. Instead, the information can be obtained directly from the FDA.


Querying the Latest CRLs

Here’s a simple alias I built to fetch the last 10 published CRLs from the OpenFDA Transparency API:

alias crl="curl -s 'https://api.fda.gov/transparency/crl.json?sort=letter_date:desc&limit=10' | jq -r '.results[] | \"\(.letter_date) - \(.company_name)\"'"

This will return a quick list of the most recent CRLs, including date and company name.


Querying Recent FDA Approvals

It is also possible to query which companies recently received FDA approvals.
This can be interesting because not every approval gets mentioned in the news.

alias approval='curl -s "https://api.fda.gov/drug/drugsfda.json?search=submissions.submission_status:\"AP\"&sort=submissions.submission_status_date:desc&limit=100" \
| jq -r "[ .results[] as \$r
           | \$r.submissions[]
           | select(.submission_status==\"AP\")
           | {date: .submission_status_date,
              sponsor: (\$r.sponsor_name // \"-\"),
              drugs: (\$r.products // [] | map(.brand_name // .generic_name // \"-\") | unique | join(\", \"))}
         ]
         | sort_by([.date,.sponsor,.drugs])
         | group_by([.date,.sponsor,.drugs])
         | map(.[0])
         | sort_by(.date) | reverse
         | .[:100]
         | .[] | \"\(.date)\t\(.sponsor)\t\(.drugs)\""
'

This will return a table of the latest 100 FDA approvals, including the approval date, sponsor name, and drug names.


Integration in .bashrc

I’ve added both API calls as aliases in my ~/.bashrc so that I can simply type crl or approval to instantly get a clean list of the latest CRLs or approvals.