---
title: "BIN Lookup API Language Guides"
description: "Language guides for the BIN Lookup API. Examples for curl, JavaScript, Python, PHP, Java, C#, and Go use the current POST /v1/bin endpoint."
section: "Guides"
url: "https://binlookupapi.com/docs/guides/"
markdown_url: "https://binlookupapi.com/docs/guides.md"
---
# Language guides

Each guide calls the current API. The host is `https://api.binlookupapi.com`. The method is POST. Send the key as a bearer token.

| Language | Guide |
|----------|-------|
| curl | [curl](/docs/guides/curl/) |
| JavaScript (Node.js) | [JavaScript](/docs/guides/javascript/) |
| Python | [Python](/docs/guides/python/) |
| PHP | [PHP](/docs/guides/php/) |
| Java | [Java](/docs/guides/java/) |
| C# | [C#](/docs/guides/csharp/) |
| Go | [Go](/docs/guides/go/) |

## Rules for every language

- Create an API key first. See the [quickstart](/docs/quickstart/).
- Store the key in an environment variable named `BINLOOKUP_API_KEY`.
- Do not put the key in browser code or in a mobile application.
- Send 6 to 11 digits. A JSON number or a string of digits is accepted.
- Do not send a full card number.
- Read `response.status` (or the HTTP status) before you read `data`.
- Read `X-Quota-Remaining` and stop before it reaches zero.
- Batch lookup is `POST /v1/bins` with a `numbers` array of 1 to 2,000 values. It requires BLAPI-500KPM, or a test-mode organisation.

The field list, error codes, and quota headers are in the [API reference](/docs/api-reference/).

## Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://api.binlookupapi.com/v1/bin")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("BINLOOKUP_API_KEY")}"
request["Content-Type"] = "application/json"
request.body = { number: 42467101 }.to_json

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  http.request(request)
end

payload = JSON.parse(response.body)
if response.code == "200"
  puts payload["data"]["scheme"]
else
  warn payload["error"]
end
```

For a batch, send `numbers` to `POST /v1/bins`. See [Batch lookups](/docs/batch-lookups/).

## Related pages

- [Quickstart](/docs/quickstart/)
- [API reference](/docs/api-reference/)
- [API keys](/docs/api-keys/)
- [Billing](/docs/subscriptions/)
