You have a SWIFT/BIC code coming from a form, webhook, or CSV and you need to validate it programmatically before sending a payment or storing it. By the end of this article, you’ll be able to validate a SWIFT code and fetch its parsed components using a single HTTP GET to a production endpoint you can ship this week.
What this API does and when to use it
The SWIFT Code Lookup API validates a given SWIFT (BIC) code and returns structured data about it. Teams use it to gate bank transfer flows, clean financial datasets, and add server-side validation to onboarding or payouts. You pass a SWIFT code; the API responds with a status, a human-readable message, and a structured object that includes the code and a breakdown.
Because this is an API on Zyla API Hub, you get one account, one API key, and a subscription-and-quota model across the marketplace. If you’re already using other Zyla APIs for finance or verification, you can add this check to your stack without managing another credential.
Browse the broader catalog at zylalabs.com—there are more than 10,000 public APIs available under a consistent developer experience.
Getting started on Zyla API Hub
To integrate quickly:
- Open the SWIFT Code Lookup API listing on Zyla API Hub and click Subscribe. The first API you add can start with a 7-day trial or 50 requests, depending on availability. There is no Free Plan; usage is subscription + quota, not pay-per-call—check the API page for current access options and pricing.
- Copy your API key from your account. Authentication is via header: Authorization: Bearer YOUR_API_KEY.
- Call the endpoint below from your server or tool of choice.
You can always return to zylalabs.com to manage subscriptions, quotas, and keys across APIs.
Endpoint you’ll actually use
The SWIFT Code Lookup API exposes a single lookup endpoint you can call directly with an HTTP GET. Use this when you have a SWIFT/BIC code in hand and you want a validation result and a parsed breakdown.
Code Lookup
- Method: GET
- URL: https://zylalabs.com/api/1714/swift-code-lookup-api/1327/code-lookup
- Required query parameter:
- code (string): the SWIFT/BIC you want to validate. Example value: ADTVBRDF
- Auth: Authorization: Bearer YOUR_API_KEY
Copy-paste cURL
This is the quickest way to test the live service from your terminal. Replace YOUR_API_KEY with your key:
curl -s -X GET "https://zylalabs.com/api/1714/swift-code-lookup-api/1327/code-lookup?code=ADTVBRDF" \
-H "Authorization: Bearer YOUR_API_KEY"
Official example response
The API returns a JSON document with a top-level status and success indicator, a message, and a data object containing the code and its breakdown. Here is the official sample payload:
{
"status": 200,
"success": true,
"message": "SWIFT code AXISINBB301 is valid",
"data": {
"swift_code": "AXISINBB301",
"bank": null,
"city": null,
"branch": null,
"address": null,
"post_code": null,
"country": null,
"country_code": null,
"breakdown": {
"swift_code": "AXISINBB301",
"bank_code": null,
"country_code": null,
"location_code": null,
"code_status": null,
"branch_code": null
}
}
}
What to read in practice:
- status and success: use these to gate your flow. A 200 with success: true means the lookup succeeded.
- message: a human-readable validation message you can log for operators or surface in admin tools.
- data.swift_code: the normalized SWIFT/BIC that was validated.
- data.breakdown: a structured split of the code into components. Individual fields may be null when not available.
Python example you can paste into your service
The snippet below calls the same endpoint and shows how to handle the response fields and nulls safely. The URL and parameter values match the official cURL above, so you can run this without editing anything except your API key.
import os
import requests
API_KEY = os.environ.get("ZYLALABS_API_KEY", "YOUR_API_KEY")
URL = "https://zylalabs.com/api/1714/swift-code-lookup-api/1327/code-lookup"
params = {"code": "ADTVBRDF"}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(URL, params=params, headers=headers, timeout=10)
resp.raise_for_status()
data = resp.json()
# Basic gating
if not data.get("success"):
raise SystemExit(f"Lookup failed: {data.get('message')}")
print(f"Message: {data.get('message')}")
payload = data.get("data", {}) or {}
swift = payload.get("swift_code")
bank = payload.get("bank") # may be None
country = payload.get("country") # may be None
breakdown = (payload.get("breakdown") or {})
bank_code = breakdown.get("bank_code") # may be None
country_code = breakdown.get("country_code") # may be None
branch_code = breakdown.get("branch_code") # may be None
print("Validated SWIFT code:", swift)
print("Bank (if available):", bank)
print("Country (if available):", country)
print("Breakdown:", {
"bank_code": bank_code,
"country_code": country_code,
"branch_code": branch_code
})
How to wire this into real flows
Most teams call this API server-side from payment creation or beneficiary onboarding endpoints. A common pattern:
- User submits bank details, including a SWIFT/BIC code.
- Your backend validates the SWIFT code by calling the Code Lookup endpoint before saving or using it.
- If success is true, continue; if false or status is not 200, reject the input and log message for review.
Other practical uses:
- Batch cleanup: iterate over SWIFT codes in a CSV and store only rows that pass validation.
- Reconciliation tooling: auto-flag entries with unexpected breakdown values for manual QA.
- Admin dashboards: show the message and breakdown next to user-submitted SWIFT codes.
Implementation details that save time
- Authentication: every request must include Authorization: Bearer YOUR_API_KEY.
- HTTP method: GET only. Include code as a query parameter.
- Nulls: fields like bank, country, and individual breakdown parts can be null. Always null-check before use.
- Caching: if you repeatedly validate the same SWIFT code, cache the result in your datastore to reduce latency and quota usage. A simple in-memory TTL cache or a row keyed by SWIFT code usually suffices.
- Observability: log the message field when rejecting input for faster debugging in support escalations.
- Security: do not log user API keys. Store your Zyla API key in environment variables or a secrets manager.
- Quotas: usage on Zyla APIs is subscription + quota. The first API can start with a 7-day trial or 50 requests. For current limits, view the API page in your account.
Error handling patterns
While the example above shows a successful lookup, production code should guard for:
- Non-200 HTTP responses: treat as transient failures or user input errors depending on context.
- success false: read message for a short human explanation and decide whether to retry or reject.
- Network timeouts: set reasonable client timeouts and wrap calls with retries if the operation is idempotent.
Using the API from AI agents via MCP
If you prefer to wire this lookup into an AI coding agent or IDE assistant, Zyla exposes compatible tools via MCP. Point your MCP-compatible client (e.g., Claude Code, Cursor, Windsurf) at the endpoint documented here and authorize with your API key. See the MCP documentation for details:
This lets you trigger the same Code Lookup from within an agent workflow without changing your backend. Your agent will send the same GET request and read the same fields (status, success, message, data.swift_code, data.breakdown). Keep your API key scoped to development environments when testing agent integrations.
End-to-end validation checklist
- Subscription active on Zyla API Hub and API key stored securely.
- Server-side GET call to the Code Lookup endpoint with code set to the user-supplied SWIFT/BIC.
- Check success and status before proceeding with a payment or saving a beneficiary.
- Handle null fields gracefully in your UI or data layer.
- Cache lookups by SWIFT code where appropriate.
- Log message for operations and support.
Where to get your key and run your first request
Subscribe to the API, start the 7-day trial when available, and copy your key. You can call the endpoint immediately with the cURL above and then drop the Python example into your service. Manage your usage and add other APIs across finance, data enrichment, and utilities from the same account on zylalabs.com.
Start 7-day trial on SWIFT Code Lookup API
FAQ
What input formats are supported for the code parameter?
Pass a SWIFT/BIC code as a plain string via the code query parameter in a GET request.
Which fields should I rely on to decide if a SWIFT code is valid?
Check success and status. Also read message for a concise explanation suitable for logs or admin UIs.
Why are some fields in data or breakdown null?
Not all metadata is available for every code. Always null-check fields like bank, country, and parts of breakdown before using them.
Can I test this from my terminal before integrating?
Yes. Use the provided cURL command with your API key to verify the endpoint and your auth header quickly.
How is billing handled?
Zyla APIs use a subscription + quota model, not pay-per-call. The first API can start with a 7-day trial or 50 requests depending on availability—check the API listing in your account for current options.