1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34629],{81179:function(e,s,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/apis/bin",function(){return i(40386)}])},40386:function(e,s,i){"use strict";i.r(s),i.d(s,{default:function(){return j}});var r=i(85893),a=i(67294),t=i(98811),n=i.n(t),l=i(41664),o=i.n(l),c=i(10241),d=i(7636),p=i(15600),h=i(96503),u=i(49152);let m={curl:`curl -X GET "https://api.api-ninjas.com/v2/bin?bin=405316" \\ 2 -H "X-Api-Key: YOUR_API_KEY"`,python:`import requests 3 4bin = '405316' 5api_url = 'https://api.api-ninjas.com/v2/bin?bin={}'.format(bin) 6response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'}) 7if response.status_code == requests.codes.ok: 8 print(response.text) 9else: 10 print("Error:", response.status_code, response.text)`,javascript:`var bin = '405316' 11$.ajax({ 12 method: 'GET', 13 url: 'https://api.api-ninjas.com/v2/bin?bin=' + bin, 14 headers: { 'X-Api-Key': 'YOUR_API_KEY'}, 15 contentType: 'application/json', 16 success: function(result) { 17 console.log(result); 18 }, 19 error: function ajaxError(jqXHR) { 20 console.error('Error: ', jqXHR.responseText); 21 } 22});`,nodejs:`const request = require('request'); 23 24var bin = '405316'; 25request.get({ 26 url: 'https://api.api-ninjas.com/v2/bin?bin=' + bin, 27 headers: { 28 'X-Api-Key': 'YOUR_API_KEY' 29 }, 30}, function(error, response, body) { 31 if(error) return console.error('Request failed:', error); 32 else if(response.statusCode != 200) return console.error('Error:', response.statusCode, body.toString('utf8')); 33 else console.log(body) 34});`,java:`import java.io.InputStream; 35import java.net.HttpURLConnection; 36import java.net.URL; 37 38import com.fasterxml.jackson.databind.ObjectMapper; 39 40URL url = new URL("https://api.api-ninjas.com/v2/bin?bin=405316"); 41HttpURLConnection connection = (HttpURLConnection) url.openConnection(); 42connection.setRequestProperty("accept", "application/json"); 43InputStream responseStream = connection.getInputStream(); 44ObjectMapper mapper = new ObjectMapper(); 45JsonNode root = mapper.readTree(responseStream); 46System.out.println(root.toString());`,swift:`let bin = "405316" 47let url = URL(string: "https://api.api-ninjas.com/v2/bin?bin="+bin)! 48var request = URLRequest(url: url) 49request.setValue("YOUR_API_KEY", forHTTPHeaderField: "X-Api-Key") 50let task = URLSession.shared.dataTask(with: request) {(data, response, error) in 51 guard let data = data else { return } 52 print(String(data: data, encoding: .utf8)!) 53} 54task.resume()`},x=[{group:"Payment Type",value:"prepaid",description:"Loaded funds before use"},{group:"Payment Type",value:"credit",description:"Traditional credit with billing cycle"},{group:"Payment Type",value:"debit",description:"Direct bank account link"},{group:"Payment Type",value:"charge",description:"Full payment required each cycle"},{group:"Payment Type",value:"atm",description:"Cash withdrawal only"},{group:"Cardholder Segment",value:"personal",description:"Individual consumers"},{group:"Cardholder Segment",value:"business",description:"Small/medium businesses"},{group:"Cardholder Segment",value:"corporate",description:"Large enterprises & B2B"},{group:"Cardholder Segment",value:"government",description:"Public sector"},{group:"Card Tier",value:"basic",description:"Entry-level (Classic, Standard)"},{group:"Card Tier",value:"mid-tier",description:"Enhanced (Gold, Platinum)"},{group:"Card Tier",value:"premium",description:"High-end (Signature, Infinite, World)"},{group:"Card Tier",value:"luxury",description:"Ultra-premium (Black, Centurion, World Elite)"},{group:"Specialized Use",value:"travel",description:"T&E and travel expenses"},{group:"Specialized Use",value:"purchasing",description:"Procurement cards"},{group:"Specialized Use",value:"fleet",description:"Vehicle/fuel expenses"},{group:"Specialized Use",value:"gift",description:"Gift cards and vouchers"},{group:"Specialized Use",value:"payroll",description:"Salary disbursement"},{group:"Specialized Use",value:"benefits",description:"FSA, flex benefits, workplace programs"},{group:"Specialized Use",value:"healthcare",description:"HSA and medical expenses"}
54,{group:"Specialized Use",value:"rewards",description:"Cashback and points programs"},{group:"Specialized Use",value:"agricultural",description:"Farming operations"},{group:"Specialized Use",value:"meal",description:"Food-restricted purchases"},{group:"Form Factor",value:"virtual",description:"Digital-only cards"},{group:"Special Category",value:"proprietary",description:"Private label/store-specific"},{group:"Special Category",value:"vpay",description:"V PAY network"},{group:"Special Category",value:"mixed",description:"Multiple/uncategorized types"}],g=[{bin:"405316",brand:"Visa",type:"credit",categories:["basic"],issuer:"Jpmorgan Chase Bank N.A.",country_iso2:"US",country:"United States",is_valid:!0}];class j extends a.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.state={disableSubmit:!1,base_url:"https://api.api-ninjas.com/v2/bin",url1:"https://api.api-ninjas.com/v2/bin?bin=",param1:"405316",response:g}}componentDidMount(){window.Prism?.highlightAll()}handleSubmit(){this.setState({disableSubmit:!0,response:null});let e=this.state.url1+this.state.param1;fetch(e,{headers:{"X-Api-Key":this.props.apiKey||""}}).then(e=>e.json()).then(e=>{this.setState({response:e})},e=>{}).finally(()=>{this.setState({disableSubmit:!1})}),window.gtag("event",this.state.url1.substring(27))}render(){let e=Array.from(new Set(x.map(e=>e.group)));return(0,r.jsxs)(d.Z,{title:"BIN API - API Ninjas",description:"BIN API by API Ninjas - Look up bank information from Bank Identification Numbers (BIN).",sidebarName:"BIN",children:[(0,r.jsxs)("div",{className:"d-flex flex-column flex-md-row px-4",children:[(0,r.jsx)("div",{className:"w-100 flex-md-fill max-width-md-50 px-2",children:(0,r.jsx)("div",{className:"content-inner mx-auto mt-4",children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)("div",{className:"section-block",children:(0,r.jsxs)("div",{id:"doc-header",className:"doc-header",children:[(0,r.jsx)("h1",{className:"doc-title",children:"BIN Lookup API"}),(0,r.jsx)("p",{children:"The BIN Lookup API allows you to look up bank information from Bank Identification Numbers (BIN). Our database contains hundreds of thousands of BINs worldwide."})]})})})})}),(0,r.jsx)("div",{className:"w-100 flex-md-fill max-width-md-50 px-2 pt-md-4",children:(0,r.jsx)("div",{className:"w-100 section-block",children:(0,r.jsx)(c.Z,{apiId:96})})})]}),(0,r.jsx)(u.Z,{id:"bin-endpoint",path:"/v2/bin",children:(0,r.jsxs)("div",{className:"d-flex flex-column flex-md-row px-4",children:[(0,r.jsx)("div",{className:"w-100 flex-md-fill max-width-md-50 px-2",children:(0,r.jsx)("div",{className:"content-inner mx-auto",children:(0,r.jsx)("div",{className:"doc-section",children:(0,r.jsxs)("div",{className:"section-block",children:[(0,r.jsx)("p",{children:(0,r.jsx)("code",{children:this.state.base_url})}),(0,r.jsx)("p",{children:"Returns detailed information about a bank based on the BIN number provided."}),(0,r.jsxs)("div",{className:"api-block",children:[(0,r.jsx)("h4",{children:"Parameters"}),(0,r.jsx)("ul",{className:"list-group api-list",children:(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsxs)("h5",{className:"my-1 text-muted",children:[(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"bin"})}),"\xa0\xa0required"]}),(0,r.jsx)("p",{className:"my-1",children:"The Bank Identification Number (BIN) to look up. This is typically the first 6 or 8 digits of a credit card number."})]})})]}),(0,r.jsxs)("div",{className:"api-block",children:[(0,r.jsx)("h4",{children:"Headers"}),(0,r.jsx)("ul",{className:"list-group api-list",children:(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsxs)("h5",{className:"my-1 text-muted",children:[(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"X-Api-Key"})}),"\xa0\xa0required"]}),(0,r.jsx)("p",{className:"my-1",children:"API Key associated with your account."})]})})]}),(0,r.jsxs)("div",{className:"api-block",children:[(0,r.jsx)("h4",{children:"Response"}),(0,r.jsxs)("p",{className:"mb-3",children:["A JSON array of objects, each containing the following fields, or ",(0,r.jsx)(o(),{href:"/error-codes",className:"bold",children:"an error"})," if the request is unsuccessful."]}),(0,r.jsxs)("ul",{className:"list-group api-list",children:[(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsx)("h5",{className:"my-1 text-muted",children:(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"bin"})})}),(0,r.jsx)("p",{className:"my-1",children:"The Bank Identification Number that was looked up."})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsxs)("h5",{className:"my-1 text-muted",children:[(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"brand"})})," ",(0,r.jsx)("a",{href:"/pricing",target:"_blank",className:"new-box",children:"Premium only"})]}),(0,r.jsx)("p",{className:"my-1",children:"The card brand (e.g. Visa, Mastercard, American Express)."})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsxs)("h5",{className:"my-1 text-muted",children:[(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"type"})})," ",(0,r.jsx)("a",{href:"/pricing",target:"_blank",className:"new-box",children:"Premium only"})]}),(0,r.jsxs)("p",{className:"my-1",children:["The type of card. Possible values are"," ",(0,r.jsx)("code",{children:"credit"})," or ",(0,r.jsx)("code",{children:"debit"}),"."]})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsxs)("h5",{className:"my-1 text-muted",children:[(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"categories"})})," ",(0,r.jsx)("a",{href:"/pricing",target:"_blank",className:"new-box",children:"Premium only"})]}),(0,r.jsx)("p",{className:"my-1",children:"An array of category tags for the card. Possible categories include:"}),(0,r.jsx)("div",{className:n().categoryGroups,children:e.map(e=>(0,r.jsxs)("section",{className:n().categoryGroup,children:[(0,r.jsx)("h6",{children:e}),(0,r.jsx)("dl",{children:x.filter(s=>s.group===e).map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("dt",{children:(0,r.jsx)("code",{children:e.value})}),(0,r.jsx)("dd",{children:e.description})]},e.value))})]},e))})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsxs)("h5",{className:"my-1 text-muted",children:[(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"issuer"})})," ",(0,r.jsx)("a",{href:"/pricing",target:"_blank",className:"new-box",children:"Premium only"})]}),(0,r.jsx)("p",{className:"my-1",children:"The name of the bank or financial institution that issued the card."})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsx)("h5",{className:"my-1 text-muted",children:(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"country_iso2"})})}),(0,r.jsx)("p",{className:"my-1",children:"The two-letter country code (ISO-3166-1 alpha-2) of the issuing bank."})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsx)("h5",{className:"my-1 text-muted",children:(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"country"})})}),(0,r.jsx)("p",{className:"my-1",children:"The full name of the country where the card was issued."})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsxs)("h5",{className:"my-1 text-muted",children:[(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"is_valid"})})," ",(0,r.jsx)("a",{href:"/pricing",target:"_blank",className:"new-box",children:"Premium only"})]}),(0,r.jsxs)("p",{className:"my-1",children:["Indicates whether the BIN is valid. Returns"," ",(0,r.jsx)("code",{children:"true"})," if the BIN is valid,"," ",(0,r.jsx)("code",{children:"false"})," otherwise."]})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsx)("h5",{className:"my-1 text-muted",children:(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"is_eu"})})}),(0,r.jsx)("p",{className:"my-1",dangerouslySetInnerHTML:{__html:"Whether the issuing country is an EU member state."}})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsx)("h5",{className:"my-1 text-muted",children:(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"is_eea"})})}),(0,r.jsx)("p",{className:"my-1",dangerouslySetInnerHTML:{__html:"Whether the issuing country is in the European Economic Area. This is the boundary that governs PSD2 / SCA and interchange-fee caps."}})]}),(0,r.jsxs)("li",{className:"list-group-item px-3 py-2 light-bg",children:[(0,r.jsx)("h5",{className:"my-1 text-muted",children:(0,r.jsx)("strong",{children:(0,r.jsx)("code",{children:"is_sepa"})})}),(0,r.jsx)("p",{className:"my-1",dangerouslySetInnerHTML:{__html:"Whether the issuing country is in the Single Euro Payments Area. SEPA is wider than the EEA â it also includes Switzerland, the United Kingdom, Monaco, San Marino, Andorra and Vatican City."}})]})]})]})]})})})}),(0,r.jsx)("div",{className:"w-100 flex-md-fill max-width-md-50 px-2",children:(0,r.jsxs)("div",{className:"doc-section section-block content-inner",children:[(0,r.jsx)(h.Z,{hasUser:this.props.hasUser,apiKey:this.props.apiKey||"",url:this.state.url1+this.state.param1,onSubmit:()=>this.handleSubmit(),disableSubmit:this.state.disableSubmit,response:this.state.response,defaultResponse:g,onRestore:()=>this.setState({response:g}),children:(0,r.jsxs)("div",{className:"rounded-pill mt-3",children:[(0,r.jsx)("label",{className:"sr-only",htmlFor:"inlineFormInputGroup",children:"BIN"}),(0,r.jsxs)("div",{className:"input-group mb-2",children:[(0,r.jsx)("div",{className:"input-group-prepend",children:(0,r.jsx)("div",{className:"input-group-text",children:"bin"})}),(0,r.jsx)("input",{id:"sample-api-request",className:"form-control api-example-query",defaultValue:"405316",onChange:e=>this.setState({param1:e.currentTarget.value})})]})]})}),(0,r.jsxs)("div",{id:"searchcodeexample",className:"api-block my-4",children:[(0,r.jsx)("h4",{children:"Code Examples"}),(0,r.jsx)(p.Z,{samples:m,apiKey:this.props.apiKey})]}),(0,r.jsx)("div",{children:(0,r.jsx)("p",{className:"font-14",children:"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."})})]})})]})})]})}}}},function(e){e.O(0,[14289,27919,71979,10241,47269,84205,49774,92888,40179],function(){return e(e.s=81179)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.