Sort Code API
The Sort Code API is a comprehensive sort code checker and sort code lookup tool. Validate any 6-digit UK sort code and retrieve full branch information including bank name, address, and payment scheme support (Bacs, CHAPS, Faster Payments).
A sort code is a 6-digit number that identifies the bank and branch holding a UK bank account, usually written as three pairs separated by hyphens (e.g. 20-00-00). It is used for routing domestic UK payments via Bacs, CHAPS, Faster Payments, and Cheque & Credit.
Looking up bank codes in other countries? See our Routing Number API (US), Canada Routing Number API, and BSB API (Australia).
Available endpoints:
- /v1/sortcode - Look up a UK bank branch by sort code
- /v1/sortcodesearch - Search for UK branches by bank name and location
From 5,165 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 326ms | 366ms | 425ms | 602ms | 1271ms |
Didn't find what you were looking for? Suggest an improvement
/v1/sortcode GET
https://api.api-ninjas.com/v1/sortcode
Returns detailed information about a UK bank branch based on its sort code.
Parameters
sort_coderequiredThe 6-digit UK sort code, with or without hyphens (e.g.
20-00-00or200000).
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
bank_namepremium onlyThe name of the bank.
sort_codeThe 6-digit sort code, hyphenated.
branch_namepremium onlyThe name of the branch.
street_addresspremium onlyThe street address of the branch.
cityThe city of the branch.
postcodeThe UK postcode of the branch.
countryAlways
GB.phone_numberpremium onlyThe customer service phone number of the bank.
bacs_supportedpremium onlyWhether the branch supports Bacs Direct Debit and Direct Credit payments.
chaps_supportedpremium onlyWhether the branch supports CHAPS same-day wire transfers.
faster_payments_supportedpremium onlyWhether the branch supports Faster Payments.
swift_codepremium onlyThe SWIFT/BIC code of the bank, useful for international wire transfers. May be
nullif the bank does not participate in SWIFT. See our SWIFT Code API for full SWIFT lookups.checksum_validWhether the sort code passes the modulus check defined by the published Vocalink validation rules.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/sortcode?sort_code=20-00-00Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/sortcode?sort_code=20-00-00" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
/v1/sortcodesearch GETPremium Only
https://api.api-ninjas.com/v1/sortcodesearch
Search for UK bank branches and their sort codes by bank name and location. Returns a list of branches matching the search criteria.
At least one of the parameters listed below is required. Each request can only return up to 10 results - use the offset parameter to paginate through results.
Parameters
bank_nameoptionalBank name to search for.
cityoptionalCity name to search for branches.
postcodeoptionalUK postcode (full or outward only, e.g.
E14) to search for branches.offsetoptional annual subscriptions onlyNumber of results to offset for pagination.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the same fields as the previous response , or an error if the request is unsuccessful.
Sample Search Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/sortcodesearch?bank_name=BarclaysHeaders
X-Api-KeyLog in or sign up to get your API Key