theswiftcodes APItheswiftcodes.com ↗
Look up and validate SWIFT/BIC codes, IBANs, and US routing numbers across 205+ countries. Search banks by country, city, or institution name.
What is the theswiftcodes API?
This API exposes 9 endpoints covering SWIFT/BIC code lookup, IBAN validation, and US routing number verification sourced from theswiftcodes.com, which indexes data across approximately 205 countries. The get_swift_codes_by_country endpoint returns paginated bank records including swift_code, bank, city, and branch, while validate_swift_code and validate_iban return structured validation status alongside bank name, address, and checksum details.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/ab1745a7-aa6a-45d7-bfcb-90aafaefec26/get_all_countries' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace theswiftcodes-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: SWIFT Codes API — browse countries, look up codes, validate payments."""
from parse_apis.the_swift_codes_api import SwiftCodes, CountryIso, SwiftCodeNotFound
client = SwiftCodes()
# List available countries, take a few to show the catalog.
for country in client.countries.list(limit=3):
print(country.name, country.slug)
# Construct a country by slug and browse its featured banks.
us = client.country("united-states")
for bank in us.banks.list(limit=3):
print(bank.name, bank.slug)
# Get SWIFT codes for a bank, then inspect connection status.
bank = us.banks.list(limit=1).first()
if bank:
for code in bank.swift_codes(limit=3):
print(code.swift_code, code.bank_name, code.connection)
# Look up a specific SWIFT code's full details via the country sub-resource.
detail = us.swift_codes.get(swift_code="CHASUS33")
print(detail.bank_name, detail.address, detail.city, detail.postcode)
# Cascading search: find banks in a country using the CountryIso enum.
result = client.searchresults.search(country_iso=CountryIso.US, bank_name="Chase")
if result.cities:
for entry in result.cities[:3]:
print(entry.value)
# Validate a SWIFT code and print the outcome.
validation = client.swiftvalidations.validate(swift="CHASUS33")
print(validation.status, validation.bank, validation.swift_code_bic)
# Typed error handling: attempt to get a non-existent SWIFT code.
try:
us.swift_codes.get(swift_code="XXXXXX99")
except SwiftCodeNotFound as exc:
print(f"Not found: {exc.swift_code} in {exc.country_slug}")
print("exercised: countries.list / banks.list / bank.swift_codes / swift_codes.get / searchresults.search / swiftvalidations.validate")
Get list of all countries with their slugs. Returns approximately 205 countries available on the site. Each country slug can be used to browse SWIFT codes or featured banks for that country.
No input parameters required.
{
"type": "object",
"fields": {
"items": "array of country objects with name, url, and slug"
},
"sample": {
"data": {
"items": [
{
"url": "https://www.theswiftcodes.com/albania/",
"name": "ALBANIA",
"slug": "albania"
},
{
"url": "https://www.theswiftcodes.com/united-states/",
"name": "UNITED STATES",
"slug": "united-states"
}
]
},
"status": "success"
}
}About the theswiftcodes API
SWIFT Code Lookup and Search
The get_all_countries endpoint returns a list of ~205 countries, each with a slug field used as the country_slug parameter in downstream calls. get_swift_codes_by_country accepts that slug plus an optional page integer and returns up to 50 SWIFT code entries per page with total_pages metadata for iteration. For targeted lookups, get_swift_code_details accepts a specific swift_code and country_slug and returns bank_name, address, city, postcode, branch, and a connection field indicating Active or Passive status.
Search by Bank or City
search_swift_codes implements a cascading search over three parameters: country_iso (required, two-letter ISO code), bank_name (optional), and city_name (optional). Supplying only country_iso returns an array of banks. Adding bank_name returns matching cities. Including all three parameters returns an array of swift_codes. The get_featured_banks_by_country endpoint surfaces a curated list of prominent banks per country, returning a slug value usable in get_swift_codes_by_bank, which paginates all SWIFT codes for that institution including address, postcode, and connection status.
Validation Endpoints
validate_swift_code accepts a single swift string and returns a status of Valid or Invalid, the bank name, address, and a human-readable message. validate_iban returns status, country, checksum, bban, and account_number extracted from the IBAN. validate_routing_number is US-specific and returns bank, address, city, state, zip, and phone for recognized routing numbers. All three validation endpoints return an empty object when the input is not recognized.
The theswiftcodes API is a managed, monitored endpoint for theswiftcodes.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when theswiftcodes.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official theswiftcodes.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Verify a SWIFT/BIC code before initiating an international wire transfer, using
validate_swift_codeto confirm bank name and active status. - Build a bank directory for a fintech app by paginating
get_swift_codes_by_countryacross all 205 countries. - Validate IBANs in a payment form using
validate_ibanto extractaccount_number,checksum, and country before submission. - Check US ACH routing numbers in a payment flow with
validate_routing_numberto surface bank name and address for user confirmation. - Power a bank autocomplete widget using
search_swift_codescascading through country, bank name, and city inputs. - Enumerate branch-level SWIFT codes for a specific institution with
get_swift_codes_by_bankusing abank_slugfromget_featured_banks_by_country. - Audit a dataset of international payment records by bulk-validating SWIFT codes and flagging any that return a Passive
connectionstatus.
| 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 | 100 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 theswiftcodes.com have an official developer API?+
What does the `connection` field in SWIFT code details mean?+
connection field returned by get_swift_code_details and get_swift_codes_by_bank indicates whether the SWIFT participant is Active or Passive. An Active connection means the bank is a live SWIFT member; Passive generally means the code exists in the directory but the institution does not receive live SWIFT messages directly.Does `search_swift_codes` require all three parameters?+
country_iso is required. Providing just country_iso returns a list of banks. Adding bank_name returns cities for that bank in the country. Only when country_iso, bank_name, and city_name are all provided does the response include the swift_codes array.Does the API cover historical or deregistered SWIFT codes?+
Is IBAN validation available for all countries, or only specific regions?+
validate_iban accepts IBAN strings for any country that uses the IBAN standard and is represented in the site's data. Coverage aligns with the ~205 countries indexed. Routing number validation via validate_routing_number is US-only. Coverage for non-IBAN payment identifiers such as sort codes or BSB numbers is not currently part of the API. You can fork it on Parse and revise to add endpoints for those identifier types.