Getting Started
The TxChk API allows you to check BIN numbers and IP addresses to prevent fraud and ensure secure transactions. All API requests should be made to the base URL:
https://txchk-api.samirdjelal.com/api/v1
All requests require the following headers:
--header 'Content-Type: application/json'
--header 'Authorization: Bearer YOUR_TOKEN'
Authentication
Before making API requests, you need to obtain an authentication token. The token will be active for 30 days.
Request
POST /auth/login
Example
const response = await fetch('https://txchk-api.samirdjelal.com/api/v1/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
username: 'user',
password: 'pass123',
}),
});curl --request POST \
--url 'https://txchk-api.samirdjelal.com/api/v1/auth/login' \
--header 'Content-Type: application/json' \
--data '{"username": "user", "password": "pass123"}'Response
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcxNjQwNjQwMH0.example_token
The response is a JWT token that should be included in the Authorization header for all subsequent requests.
| Field | Type | Description |
|---|---|---|
| JWT Token | string | A JSON Web Token (JWT) that contains encoded user information and should be included in the Authorization header for all subsequent requests. The token will be active for 30 days. |
BIN/IP Check and Match
Check both BIN number and IP address, and determine if they match.
Request
GET /bincode/check?ip=109.70.100.2&bin=450105
Example
const queryParams = new URLSearchParams();
queryParams.append('ip', '109.70.100.2');
queryParams.append('bin', '450105');
const response = await fetch(
`https://txchk-api.samirdjelal.com/api/v1/bincode/check?${queryParams.toString()}`,
{
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`,
},
}
);
const data = await response.json();curl --request GET \
--url 'https://txchk-api.samirdjelal.com/api/v1/bincode/check?ip=109.70.100.2&bin=450105' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN'
Response
{
"status": "success",
"message": null,
"data": {
"bin_code": {
"bank_name": "BA MERCHANT SERVICES, INC.",
"bank_phone": "+18665383827",
"bank_url": "http://www.bankofamerica.com",
"bin": "450105",
"card_brand": "VISA",
"card_level": null,
"card_type": "CREDIT",
"country_code_a2": "US",
"country_code_a3": "USA",
"country_name": "UNITED STATES"
},
"ip_address": {
"asn": {
"as_number": 208323,
"country": "AT",
"ip": 1833329664,
"owner": "APPLIEDPRIVACY-AS",
"prefix_len": 24
},
"country": {
"currency": null,
"iso_code_a2": "AT",
"iso_code_a3": "AUT",
"iso_code_number": "040",
"iso_code_string": "ISO 3166-2:AT",
"name": "Austria",
"region": "Europe",
"sub_region": "Western Europe"
},
"is_tor": true
},
"ip_bin_match": false
},
"errors": null
}| Field | Type | Nullable | Description |
|---|---|---|---|
| status | string | No | Status of the request. Either "success" or "failed". |
| message | string | Yes | Additional message about the request result. |
| data.bin_code | object | Yes | Information about the BIN number. |
| data.bin_code.bank_name | string | Yes | Name of the bank that issued the card. |
| data.bin_code.bank_phone | string | Yes | Phone number of the bank. |
| data.bin_code.bank_url | string | Yes | URL of the bank's website. |
| data.bin_code.bin | string | Yes | The BIN number. |
| data.bin_code.card_brand | string | Yes | Brand of the card (e.g., VISA, MASTERCARD). |
| data.bin_code.card_level | string | Yes | Level of the card (e.g., CLASSIC, GOLD, PLATINUM). |
| data.bin_code.card_type | string | Yes | Type of the card (e.g., CREDIT, DEBIT). |
| data.bin_code.country_code_a2 | string | Yes | Two-letter country code of the card issuer. |
| data.bin_code.country_code_a3 | string | Yes | Three-letter country code of the card issuer. |
| data.bin_code.country_name | string | Yes | Name of the country of the card issuer. |
| data.ip_address | object | Yes | Information about the IP address. |
| data.ip_address.asn | object | Yes | Autonomous System Number information. |
| data.ip_address.country | object | Yes | Country information for the IP address. |
| data.ip_address.is_tor | boolean | Yes | Whether the IP address is a Tor exit node. |
| data.ip_bin_match | boolean | Yes | Whether the country of the IP address matches the country of the BIN number. |
| errors | object | Yes | Errors that occurred during the request, if any. |
BIN Check
Check BIN number details.
Request
GET /bincode/check?bin=450105
Example
const queryParams = new URLSearchParams();
queryParams.append('bin', '450105');
const response = await fetch(
`https://txchk-api.samirdjelal.com/api/v1/bincode/check?${queryParams.toString()}`,
{
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`,
},
}
);
const data = await response.json();curl --request GET \
--url 'https://txchk-api.samirdjelal.com/api/v1/bincode/check?bin=450105' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN'
Response
{
"status": "success",
"message": null,
"data": {
"bin_code": {
"bank_name": "BA MERCHANT SERVICES, INC.",
"bank_phone": "+18665383827",
"bank_url": "http://www.bankofamerica.com",
"bin": "450105",
"card_brand": "VISA",
"card_level": null,
"card_type": "CREDIT",
"country_code_a2": "US",
"country_code_a3": "USA",
"country_name": "UNITED STATES"
},
"ip_address": {
"asn": null,
"country": null,
"is_tor": null
},
"ip_bin_match": null
},
"errors": null
}| Field | Type | Nullable | Description |
|---|---|---|---|
| status | string | No | Status of the request. Either "success" or "failed". |
| message | string | Yes | Additional message about the request result. |
| data.bin_code | object | Yes | Information about the BIN number. |
| data.bin_code.bank_name | string | Yes | Name of the bank that issued the card. |
| data.bin_code.bank_phone | string | Yes | Phone number of the bank. |
| data.bin_code.bank_url | string | Yes | URL of the bank's website. |
| data.bin_code.bin | string | Yes | The BIN number. |
| data.bin_code.card_brand | string | Yes | Brand of the card (e.g., VISA, MASTERCARD). |
| data.bin_code.card_level | string | Yes | Level of the card (e.g., CLASSIC, GOLD, PLATINUM). |
| data.bin_code.card_type | string | Yes | Type of the card (e.g., CREDIT, DEBIT). |
| data.bin_code.country_code_a2 | string | Yes | Two-letter country code of the card issuer. |
| data.bin_code.country_code_a3 | string | Yes | Three-letter country code of the card issuer. |
| data.bin_code.country_name | string | Yes | Name of the country of the card issuer. |
| data.ip_address | object | Yes | Information about the IP address (null for BIN-only checks). |
| data.ip_bin_match | boolean | Yes | Whether the country of the IP address matches the country of the BIN number (null for BIN-only checks). |
| errors | object | Yes | Errors that occurred during the request, if any. |
IP Check
Check IP address details.
Request
GET /bincode/check?ip=8.8.8.8
Example
const queryParams = new URLSearchParams();
queryParams.append('ip', '8.8.8.8');
const response = await fetch(
`https://txchk-api.samirdjelal.com/api/v1/bincode/check?${queryParams.toString()}`,
{
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`,
},
}
);
const data = await response.json();curl --request GET \
--url 'https://txchk-api.samirdjelal.com/api/v1/bincode/check?ip=8.8.8.8' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN'
Response
{
"status": "success",
"message": null,
"data": {
"bin_code": null,
"ip_address": {
"asn": {
"as_number": 15169,
"country": "US",
"ip": 134744064,
"owner": "GOOGLE",
"prefix_len": 24
},
"country": {
"currency": null,
"iso_code_a2": "US",
"iso_code_a3": "USA",
"iso_code_number": "840",
"iso_code_string": "ISO 3166-2:US",
"name": "United States of America",
"region": "Americas",
"sub_region": "Northern America"
},
"is_tor": false
},
"ip_bin_match": null
},
"errors": null
}| Field | Type | Nullable | Description |
|---|---|---|---|
| status | string | No | Status of the request. Either "success" or "failed". |
| message | string | Yes | Additional message about the request result. |
| data.bin_code | object | Yes | Information about the BIN number (null for IP-only checks). |
| data.ip_address | object | Yes | Information about the IP address. |
| data.ip_address.asn | object | Yes | Autonomous System Number information. |
| data.ip_address.asn.as_number | number | Yes | The Autonomous System Number. |
| data.ip_address.asn.country | string | Yes | Two-letter country code of the ASN. |
| data.ip_address.asn.ip | number | Yes | The IP address as a number. |
| data.ip_address.asn.owner | string | Yes | The owner of the ASN. |
| data.ip_address.asn.prefix_len | number | Yes | The prefix length of the ASN. |
| data.ip_address.country | object | Yes | Country information for the IP address. |
| data.ip_address.country.currency | string | Yes | Currency code of the country. |
| data.ip_address.country.iso_code_a2 | string | Yes | Two-letter country code. |
| data.ip_address.country.iso_code_a3 | string | Yes | Three-letter country code. |
| data.ip_address.country.iso_code_number | string | Yes | Numeric country code. |
| data.ip_address.country.iso_code_string | string | Yes | ISO code string for the country. |
| data.ip_address.country.name | string | Yes | Name of the country. |
| data.ip_address.country.region | string | Yes | Region of the country. |
| data.ip_address.country.sub_region | string | Yes | Sub-region of the country. |
| data.ip_address.is_tor | boolean | Yes | Whether the IP address is a Tor exit node. |
| data.ip_bin_match | boolean | Yes | Whether the country of the IP address matches the country of the BIN number (null for IP-only checks). |
| errors | object | Yes | Errors that occurred during the request, if any. |