pharmdata.co.uk APIpharmdata.co.uk ↗
Access UK pharmacy dispensing stats, NHS service data, EPS nominations, MHRA drug safety alerts, and LPC rankings via the PharmData API.
curl -X GET 'https://api.parse.bot/scraper/ec6a96d0-fd3d-4100-bfc2-07a4720d908d/search?query=DH1' \ -H 'X-API-Key: $PARSE_API_KEY'
Search for pharmacies, GP surgeries, and dispensing doctors by name, postcode, or ODS code. Returns results ordered by relevance score.
| Param | Type | Description |
|---|---|---|
| queryrequired | string | Search keyword (name, postcode, or ODS code) |
{
"type": "object",
"fields": {
"data": "array of matching locations with type, name, nacs code, address, and relevance score",
"status": "string indicating success"
},
"sample": {
"data": [
{
"nacs": "FYR53",
"name": "BOOTS",
"type": "mortar-pestle",
"address": "2/5 MARKET PLACE, DH1 3NB",
"relevance": 10.566816329956055
}
],
"status": "success"
}
}About the pharmdata.co.uk API
The PharmData API provides 8 endpoints covering UK pharmacy profiles, NHS dispensing trends, and MHRA safety alerts sourced from PharmData.co.uk. The get_pharmacy_detail endpoint returns monthly items-dispensed trends, EPS nomination counts, prescription sources, and service reports (Flu, COVID, TSP) for any individual pharmacy identified by its ODS/NACS code. National chain performance, area leaderboards, and LPC rankings are also available.
Pharmacy Search and Profiles
The search endpoint accepts a name, postcode, or ODS code as query and returns an array of matching pharmacies, GP surgeries, and dispensing doctors, each with a nacs code, address, type, and relevance score. That nacs code is the key input for get_pharmacy_detail, which returns a full profile including items_data (monthly dispensing volume trend), eps_nominations, nearest_pharmacies, prescription_sources, and flu_repo service report data. This makes it straightforward to build per-site performance dashboards or compare a pharmacy against its local competitors.
National Trends and Area Leaderboards
get_national_stats returns two top-level fields: global_trends (national NHS dispensing percentage arrays) and multiples_performance (chain-level arrays covering major pharmacy groups such as Boots, Lloyds, and Well). For regional analysis, get_areas lists all available NHS Area Teams and LPCs by name. Passing one of those names to get_area_leaderboard returns a ranked list of pharmacies in that area with each entry showing name, nacs, and items_dispensed. The get_lpc_ranking endpoint extends this with KPI-level ranking — for example, Pharmacy First consultation volumes — and accepts optional kpi and month (YYYY-MM-DD) parameters.
MHRA Drug Safety Alerts
list_mhra_alerts returns all current MHRA alerts and recalls as an array, each with title, alert_id, date, and response_deadline. Passing an alert_id to get_mhra_alert_detail retrieves the full alert including a content text summary and, where available, an mhra_url linking directly to the source article on the MHRA website. This makes it practical to pipe drug safety notices into internal compliance workflows or pharmacy management systems without manually monitoring the MHRA website.
- Track monthly items-dispensed trends for individual pharmacies using
items_datafromget_pharmacy_detail. - Build a regional pharmacy leaderboard by combining
get_areasandget_area_leaderboardto rank sites by dispensing volume. - Monitor MHRA drug recalls and response deadlines with
list_mhra_alertsand alert to relevant staff beforeresponse_deadlinepasses. - Compare EPS nomination counts across competing pharmacies in a local area to inform site acquisition decisions.
- Benchmark national pharmacy chain performance using
multiples_performancedata fromget_national_stats. - Power a Pharmacy First service dashboard by pulling LPC rankings via
get_lpc_rankingfiltered by KPI code and month. - Cross-reference a pharmacy's prescription sources with its flu and COVID service reports for contract compliance reporting.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does PharmData.co.uk have an official developer API?+
What does `get_pharmacy_detail` return beyond basic address information?+
nacs code. Fields include items_data (a monthly dispensing trend array), eps_nominations, nearest_pharmacies, prescription_sources, and flu_repo (Flu, COVID, and TSP service report data). It does not return raw prescription line-level data or patient identifiers.Does the API cover GP surgery dispensing data, not just pharmacies?+
search endpoint returns GP surgeries and dispensing doctors alongside pharmacies. However, the detailed profile endpoint (get_pharmacy_detail) is scoped to pharmacies, and dedicated GP-level dispensing breakdowns are not currently exposed. You can fork this API on Parse and revise it to add a GP-detail endpoint if that coverage is needed.Is historical dispensing data available for past years, or only recent months?+
items_data field in get_pharmacy_detail reflects the trend data PharmData publishes, which covers recent monthly periods. There is no parameter to request a specific historical date range. If you need deeper historical archives, you can fork this API on Parse and revise it to target the relevant historical data pages.What does `get_lpc_ranking` return, and how granular is the KPI filtering?+
month in YYYY-MM-DD format. The available KPI codes correspond to NHS service metrics published by PharmData. If a specific KPI code is not passed, the endpoint returns its default ranking set. The full enumeration of valid KPI codes is not documented inline — test against the get_areas output for valid area names, and consult PharmData's published service categories for KPI codes.