OpenPrescribing NHS Spend Scraper avatar

OpenPrescribing NHS Spend Scraper

Pricing

from $9.00 / 1,000 results

Go to Apify Store
OpenPrescribing NHS Spend Scraper

OpenPrescribing NHS Spend Scraper

Scrapes monthly NHS prescribing spend, items, and cost per item from OpenPrescribing by drug name or BNF code. Returns one flat row per drug per month.

Pricing

from $9.00 / 1,000 results

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 hours ago

Last modified

Share

ParseForge

OpenPrescribing NHS Spend Scraper

Scrape NHS prescribing spend data from OpenPrescribing by drug name or BNF code. Get monthly spend, items, and cost per item for every chemical, practice, or CCG. No API key. Export to CSV, JSON, Excel, or XML.

OpenPrescribing publishes monthly NHS prescribing data, but the website has no bulk export and the official NHSBSA files are huge and hard to filter. This Actor reads the public OpenPrescribing pages directly, resolves drug names to BNF chemicals, and returns each drug's monthly spend, items, and cost per item in one flat row. You can search by drug name, pass exact BNF codes, or both.

Who uses itWhat they scrape OpenPrescribing for
Pharma market analystsTrack monthly spend and volume for a competitor drug across England
NHS commissionersMonitor prescribing trends for a therapeutic area in their CCG
Health economistsBuild time series of drug costs for cost-effectiveness models
JournalistsInvestigate changes in NHS spending on specific medicines

What it does

This Actor collects monthly NHS prescribing spend, items, and cost per item for each drug or BNF chemical from OpenPrescribing, and returns each drug-month as one flat row.

  • ๐Ÿ” Search by drug name: type "ibuprofen" or "atorvastatin" and the Actor resolves it to all matching BNF chemicals.
  • ๐ŸŽฏ Exact BNF codes: pass codes like "0407010H0" for Paracetamol to get that chemical only.
  • ๐Ÿ“… Monthly granularity: each row is one drug in one month, so you can build time series.
  • ๐Ÿ“Š Spend and volume: returns total spend, number of items, and cost per item for every match.
  • ๐Ÿงฉ Flexible input: use search terms, BNF codes, or both in the same run.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with OpenPrescribing data

๐Ÿ“ˆ Track competitor drug spend.

A pharma analyst runs the Actor monthly for a competitor's brand name and watches spend and items trend across England.

๐Ÿฉบ Monitor CCG prescribing.

An NHS commissioner passes a list of BNF codes for high-cost drugs and gets monthly spend to spot outliers.

๐Ÿ’ฐ Build cost-effectiveness models.

A health economist scrapes five years of monthly cost per item for a drug class to feed a Markov model.

๐Ÿ“ฐ Investigate spending changes.

A journalist searches for a recently launched drug and compares monthly spend before and after a policy change.

Why choose this scraper

What you get
No API keyOpenPrescribing has no public API, so this Actor reads the pages directly.
Drug name resolutionType a common name and get all BNF chemicals, no need to look up codes.
Monthly time seriesEach row is one drug in one month, ready for trend analysis.
Flat schemaEvery record has the same fields, so you can merge runs without cleaning.

How it compares

No other Store actor targets OpenPrescribing the same way, so the honest comparison is with the alternatives teams actually weigh.

OpenPrescribing NHS Spend ScraperBuild it in-houseBy hand
SetupRun it now, zero configDays of engineeringNone, but hours per pull
When OpenPrescribing changesMaintained for youYou fix itYou re-learn the page
Proxies, retries, anti-botBuilt inYour problemBrowser only
OutputFixed JSON schema, CSV/Excel exportWhatever you buildCopy-paste
CostPay per resultEngineering timeAnalyst hours

Configure the run

Drive the Actor from drug names, exact BNF codes, or both, and set a maximum number of records to keep runs predictable. The Input tab lists every parameter.

A first run with the defaults:

{
"searchTerms": [
"atorvastatin"
],
"maxItems": 10
}

A larger pull:

{
"searchTerms": [
"atorvastatin"
],
"maxItems": 200
}

Pricing

Pay-per-result: $0.011 per result collected. You pay only for the results written to your dataset.

Results collectedApproximate cost
100 results$1.10
1,000 results$11.00
10,000 results$110.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the OpenPrescribing NHS Spend Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to OpenPrescribing through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/openprescribing-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results?

Check that your search term is spelled correctly and is a drug or chemical name used in the NHS. If you passed a BNF code, verify it is a valid chemical code, not a product or presentation code.

The Actor returned fewer records than I expected.

OpenPrescribing may not have data for every month for every chemical. Also, if you are on the free plan, the preview is limited to 10 records. Upgrade to a paid plan and set a higher "Maximum records".

My search term resolved to the wrong drug.

Drug names can be ambiguous. Use an exact BNF code instead, or refine your search term to the full chemical name.

The run failed with a timeout.

Large searches with many chemicals can take time. Reduce the number of search terms or BNF codes, or increase the Actor's timeout in the run settings.

FAQ

QuestionAnswer
Do I need an API key or login?No. The Actor reads public OpenPrescribing pages directly, so no registration or key is required.
What is a BNF code?A BNF code is the NHS's unique identifier for a chemical or product, like "0407010H0" for Paracetamol. You can pass these directly or let the Actor resolve drug names to codes.
How do I search by drug name?Add one or more names to the "Prescribing search terms" field, for example "ibuprofen". The Actor resolves each name to all matching BNF chemicals and scrapes them all.
Can I mix search terms and BNF codes?Yes. Both fields are optional, but at least one is required. If you provide both, the Actor scrapes the union of all resolved chemicals.
What does one row in the output represent?One row is one drug (BNF chemical) in one month, with its total spend, number of items, and cost per item for that month.
What time period does the data cover?OpenPrescribing publishes monthly data from 2010 onwards. The Actor returns whatever months are available for the selected chemicals.
Is there a limit on how many records I can scrape?Free users are limited to 10 records as a preview. Paid users can set "Maximum records" up to 1,000,000.
Can I get data for a specific practice or CCG?This Actor scrapes national-level chemical data. For practice or CCG breakdowns, you would need a different approach or the raw NHSBSA files.
What export formats are supported?You can export the dataset as CSV, JSON, Excel, or XML from the Apify platform.
How often should I run this Actor?OpenPrescribing updates monthly, so a monthly scheduled run is typical. You can also run on demand for ad hoc analysis.
  • openfda-scraper: Use this for US FDA drug data, including labels and adverse events, when you need a non-UK source.

Browse the full ParseForge collection for more scrapers.

๐Ÿ†˜ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

โš ๏ธ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by OpenPrescribing, Bennett Institute for Applied Data Science, University of Oxford. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.