How to tell credit card's country of origin by its number?
Asked Answered
A

3

24

I'm trying to develop an application, which would give access to different services for people from different regions of the world.

Let's say, someone enters card number 1111-1111-1111-1111 . How do I use it to tell the country of origin?

I know that this is possible, because paypal and apple do it.

Angadresma answered 2/7, 2012 at 15:57 Comment(3)
There's no country information encoded in the number itself; you need access to the customer's account information to get that. See adywicaksono.wordpress.com/2008/02/17/…Tubb
@RobertHarvey That's not entirely true, see my postDeoxyribonuclease
binbase.com , dev.maxmind.com/minfraudOssifrage
D
5

At first, I questioned whether this information could be gleened from the credit card number alone.

Then I found it here:

http://en.wikipedia.org/wiki/List_of_Bank_Identification_Numbers

Edit - Don't forget about PCI Compliance if you are taking credit card numbers for payment.

Edit - Apparently the previous wikipedia page has been deleted. This appears to have similar information.

Deoxyribonuclease answered 2/7, 2012 at 16:3 Comment(3)
Well, sure. But couldn't I get a Visa card in the United States and use it while living abroad, or vice versa? Sure, you can get broad provider information, but I don't see how that would be useful at all for marketing purposes.Tubb
@RobertHarvey That is true. (I've done it) I'm interested in what the OP is trying to do with the country information. I would imagine that IP based geolocation would suit well for detecting what country a transaction is coming from.Deoxyribonuclease
the link isnt availableOssifrage
S
37

Use BinList. It simply tells you the country of origin by checking the first 6 digits of the card number. It has a neat Json based API as well.

Safelight answered 22/1, 2016 at 17:5 Comment(5)
BinList returns incorrect brand (Visa) and country for my MasterCard, so I would not trust it.Upbraid
@P.Šileikis I agree with you. Unfortunately there is no formal API for this kind of work.Safelight
From the wikipedia article en.wikipedia.org/wiki/… the first 6-digits (BIN number) allows to define country / ranges - Binlist ranges are : github.com/binlist/data/blob/master/ranges.csvRockbottom
it works for my cards (+1)Bulldozer
unfortunately, the site stated that they don't update their data anymore and they launched a paid version under iinlist.comLucy
D
5

At first, I questioned whether this information could be gleened from the credit card number alone.

Then I found it here:

http://en.wikipedia.org/wiki/List_of_Bank_Identification_Numbers

Edit - Don't forget about PCI Compliance if you are taking credit card numbers for payment.

Edit - Apparently the previous wikipedia page has been deleted. This appears to have similar information.

Deoxyribonuclease answered 2/7, 2012 at 16:3 Comment(3)
Well, sure. But couldn't I get a Visa card in the United States and use it while living abroad, or vice versa? Sure, you can get broad provider information, but I don't see how that would be useful at all for marketing purposes.Tubb
@RobertHarvey That is true. (I've done it) I'm interested in what the OP is trying to do with the country information. I would imagine that IP based geolocation would suit well for detecting what country a transaction is coming from.Deoxyribonuclease
the link isnt availableOssifrage
T
4

checkout https://binlist.io/ opensource and it looks like they have a maintained csv file on their github page: https://github.com/iannuttall/binlist-data

Toxicosis answered 23/6, 2020 at 10:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.