Gabe Riddle
Gabe Riddle

Reputation: 59

PHP - How to get phone carrier info from number

Are there any good, free ways to do this?

I found http://fonefinder.net, which looks okay. If that's my best best, how can I query it with a phone number and get the returned carrier? (I don't see an API).

Upvotes: 5

Views: 4983

Answers (2)

Blender
Blender

Reputation: 298196

Well, it looks like your query URL is as follows:

http://www.fonefinder.net/findome.php?npa={First Three}&nxx={Next Three}&thoublock={Last Four}

I would just get that page, use PHP's XML parser on the document. This should get you started:

<?php

$xmlDOC = simplexml_load_file(/* Your Request URL */);

print_r($xmlDOC->center->table[1]->tbody->tr[1]->td[4]->a->attributes());

?>

Upvotes: 4

Denis Petrov
Denis Petrov

Reputation: 123

There is this website http://phonenumberprovider.com, for some reason it doesn't have a public API yet, but the developer told me that I can use this at the moment:

http://phonenumberprovider.com/api/json/+187605591648

Returns JSON like this:

{"result":"success","description":"Phone number provider found","operator":"JAMAICA","operatorPrefix":"1876","operatorCountry":"JM"}

Upvotes: 1

Related Questions