api-ninjas-com Sort Code API

The Sort Code API allows you to look up and validate any UK sort code. Free sort code checker and sort code lookup for every UK bank branch.

Operations 2

GET /v1/sortcode Get UK Bank Branch Information by Sort Code #
GET /v1/sortcodesearch Search for UK Bank Branches and Sort Codes #

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/api-ninjas-com:api-ninjas-com-sort-code-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

api-ninjas-com-sort-code-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Sort Code API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Sort Code
  description: The Sort Code API allows you to look up and validate any UK sort code. Free sort code checker and sort code lookup for every UK bank branch.
paths:
  /v1/sortcode:
    get:
      summary: Get UK Bank Branch Information by Sort Code
      description: Looks up and validates a 6-digit UK sort code, returning its bank and branch details. Requires `sort_code`. To search by bank, city or postcode use /sortcodesearch.
      operationId: getSortCodeInfo
      tags:
      - Sort Code
      parameters:
      - name: sort_code
        in: query
        description: The 6-digit UK sort code, with or without hyphens (e.g. 20-00-00 or 200000).
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SortCodeOpenapi_BranchInfo'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
  /v1/sortcodesearch:
    get:
      summary: Search for UK Bank Branches and Sort Codes
      description: Finds UK bank branches and their sort codes by bank name, city or postcode. To look up a single sort code that is already known use /sortcode.
      operationId: searchSortCodes
      tags:
      - Sort Code
      parameters:
      - name: bank_name
        in: query
        description: Bank name to search for. At least one of bank_name, city, or postcode is required. Premium only.
        required: false
        schema:
          type: string
      - name: city
        in: query
        description: City name to search for branches. Premium only.
        required: false
        schema:
          type: string
      - name: postcode
        in: query
        description: UK postcode (full or outward only, e.g. E14) to search for branches. Premium only.
        required: false
        schema:
          type: string
      - name: offset
        in: query
        description: Number of results to offset for pagination. Available for annual subscriptions only.
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SortCodeOpenapi_BranchInfo'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
components:
  schemas:
    SortCodeOpenapi_BranchInfo:
      type: object
      properties:
        bank_name:
          type:
          - string
          - 'null'
          description: The name of the bank. Premium only.
        sort_code:
          type: string
          description: The 6-digit sort code, hyphenated.
        branch_name:
          type:
          - string
          - 'null'
          description: The name of the branch. Premium only.
        street_address:
          type:
          - string
          - 'null'
          description: The street address of the branch. Premium only.
        city:
          type:
          - string
          - 'null'
          description: The city of the branch.
        postcode:
          type:
          - string
          - 'null'
          description: The UK postcode of the branch.
        country:
          type: string
          description: Always GB.
        phone_number:
          type:
          - string
          - 'null'
          description: The customer service phone number of the bank. Premium only.
        bacs_supported:
          type: boolean
          description: Whether the branch supports Bacs Direct Debit and Direct Credit payments. Premium only.
        chaps_supported:
          type: boolean
          description: Whether the branch supports CHAPS same-day wire transfers. Premium only.
        faster_payments_supported:
          type: boolean
          description: Whether the branch supports Faster Payments. Premium only.
        swift_code:
          type:
          - string
          - 'null'
          description: The SWIFT/BIC code of the bank, useful for international wire transfers. Premium only.
        checksum_valid:
          type: boolean
          description: Whether the sort code passes the modulus check defined by the published Vocalink validation rules.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api