OpenPrescribing Reference API

BNF code, organisation code and organisation-location reference lookups.

Operations 4

GET /org_details/ Organisation statistics (list size, ASTRO-PU, STAR-PU) #
GET /bnf_code/ Search BNF sections, chemicals and presentations #
GET /org_code/ Look up NHS organisations by code or name #
GET /org_location/ Organisation boundaries and locations (GeoJSON) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/openprescribing-reference-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

openprescribing-reference-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenPrescribing Reference API
  version: '1.0'
  summary: Free, open, key-less REST API over English NHS primary-care prescribing data.
  description: OpenPrescribing.net exposes NHS England primary-care (GP) prescribing data as a free, public, RESTful API.
  license:
    name: MIT
    url: https://github.com/bennettoxford/openprescribing/blob/main/LICENSE.txt
  contact:
    name: Bennett Institute for Applied Data Science
    url: https://openprescribing.net/api/
servers:
- url: https://openprescribing.net/api/1.0
  description: Production
tags:
- name: Reference
  description: BNF code, organisation code and organisation-location reference lookups.
paths:
  /org_details/:
    get:
      operationId: getOrgDetails
      summary: Organisation statistics (list size, ASTRO-PU, STAR-PU)
      description: Practice-level statistics such as total list size, ASTRO-PU and STAR-PU values for one or more organisations, optionally restricted to a set of keys.
      tags:
      - Reference
      parameters:
      - name: org_type
        in: query
        schema:
          type: string
        description: Organisation type.
      - name: keys
        in: query
        schema:
          type: string
        description: Comma-separated list of statistic keys to return.
      - name: org
        in: query
        schema:
          type: string
        description: Comma-separated list of organisation codes.
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          $ref: '#/components/responses/GenericList'
        '400':
          $ref: '#/components/responses/BadRequest'
  /bnf_code/:
    get:
      operationId: getBnfCodes
      summary: Search BNF sections, chemicals and presentations
      description: Search the BNF hierarchy (chapters, sections, paragraphs, chemicals, products and presentations) by name or code.
      tags:
      - Reference
      parameters:
      - name: q
        in: query
        schema:
          type: string
        description: Search term(s); comma-separated for multiple codes/names.
      - name: exact
        in: query
        schema:
          type: string
          enum:
          - 'true'
          - 'false'
        description: When "true", match codes/names exactly instead of prefix/substring.
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          $ref: '#/components/responses/BnfCodeList'
  /org_code/:
    get:
      operationId: getOrgCodes
      summary: Look up NHS organisations by code or name
      description: Look up NHS organisations (practice, PCN, Sub-ICB Location, ICB, Regional Team) by code or name.
      tags:
      - Reference
      parameters:
      - name: q
        in: query
        schema:
          type: string
        description: Organisation code or name to search for.
      - name: org_type
        in: query
        schema:
          type: string
          enum:
          - practice
          - pcn
          - ccg
          - stp
          - regional_team
        description: Restrict the search to a single organisation type.
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          $ref: '#/components/responses/GenericList'
  /org_location/:
    get:
      operationId: getOrgLocation
      summary: Organisation boundaries and locations (GeoJSON)
      description: Sub-ICB Location / ICB / PCN / Regional Team boundaries, or approximate practice point locations, returned as a GeoJSON FeatureCollection.
      tags:
      - Reference
      parameters:
      - name: org_type
        in: query
        schema:
          type: string
          enum:
          - practice
          - ccg
          - pcn
          - stp
          - regional_team
          default: practice
        description: Organisation type.
      - name: q
        in: query
        schema:
          type: string
        description: Comma-separated organisation codes.
      - name: centroids
        in: query
        schema:
          type: string
        description: When set, return boundary centroids instead of full polygons.
      responses:
        '200':
          description: GeoJSON FeatureCollection.
          content:
            application/json:
              schema:
                type: object
components:
  responses:
    GenericList:
      description: A list of result objects.
      content:
        application/json:
          schema:
            type: array
            items:
              type: object
        text/csv:
          schema:
            type: string
    BadRequest:
      description: Invalid request (bad/missing parameter, unrecognised org type, invalid code).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BnfCodeList:
      description: A list of matching BNF hierarchy entries.
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/BnfCode'
  parameters:
    format:
      name: format
      in: query
      schema:
        type: string
        enum:
        - json
        - csv
        default: json
      description: Response format. May also be supplied as a URL suffix (.json / .csv) via DRF format_suffix_patterns.
  schemas:
    BnfCode:
      type: object
      properties:
        type:
          type: string
          description: One of BNF chapter/section/paragraph/subparagraph, chemical, product, product format.
        id:
          type: string
        name:
          type: string
        is_generic:
          type: boolean
        section:
          type: string
    Error:
      type: object
      description: Django REST Framework error envelope.
      properties:
        detail:
          type: string