client = Catchid::Client.new('api-key')
response = client.find(["+12345678901"])
=> {"incorrect"=>[], "data"=>[{"query"=>"+12345678901", "contacts"=>[{"uid"=>"2e3766b2-fefe-46b6-a3ba-6fd9ce766cae", "type"=>"instagram"}, {"uid"=>"8bb2dc2e-4620-4a02-92c7-fbb342d864b2", "type"=>"facebook"}, {"uid"=>"2c304ec8-04f6-4dcf-b2b1-a2786fc280f9", "type"=>"phone"}]}], "credits"=>{"show_credits"=>89352, "find_credits"=>97501}}
puts response ["data"]
response["data"].each{|r| puts r["contacts"]}
uids = response["data"].map{|r| r["contacts"].map{|c| c["uid"]}}.flatten
=> ['2e3766b2-fefe-46b6-a3ba-6fd9ce766cae', '8bb2dc2e-4620-4a02-92c7-fbb342d864b2' '2c304ec8-04f6-4dcf-b2b1-a2786fc280f9']
contacts = client.show(uids)
=> {"data"=>[{"uid"=>"2c304ec8-04f6-4dcf-b2b1-a2786fc280f9", "type"=>"phone", "contact"=>"+98765432109"}, {"uid"=>"8bb2dc2e-4620-4a02-92c7-fbb342d864b2", "type"=>"facebook", "contact"=>"https://www.facebook.com/profile.php?id=xxxtestxxx"}, {"uid"=>"2e3766b2-fefe-46b6-a3ba-6fd9ce766cae", "type"=>"instagram", "contact"=>"https://www.instagram.com/test"}], "credits"=>{"show_credits"=>89349, "find_credits"=>97501}}
contacts["data"].each{|c| puts "#{c["type"]} - #{c["contact"]}"}
Download library
// create api instance
String token = "YOUR_TOKEN_HERE";
Api api = new Api(token);
// get credits info
CreditsInfoResponse resp = (CreditsInfoResponse)api.getCreditsInfo();
System.out.println(resp.creditsAmount());
// find contacts
String[] contacts = {
"+12345678900",
"example_email@domain.com",
"https://www.facebook.com/profile.php?id=1234567890",
};
ApiResponse result = api.findUids(new ArrayList<String>(Arrays.asList(contacts)));
FindUidsResponse r = (FindUidsResponse) result;
List<FindResult> foundContacts = r.getFoundContacts();
System.out.println(foundContacts);
// show found contacts
ArrayList<String> uids = new ArrayList<String>(foundContacts.size());
for (FindResult fr : foundContacts) {
for (ContactInfo c : fr.getContactInfos()) {
uids.add(c.getUid());
}
}
result = api.showUids(uids);
System.out.println(result);
Download library
Instal via composer:
Add to composer.json:
"repositories": [
{
"type": "package",
"package": {
"name": "catchid/catchid",
"version": "0.2.1",
"dist": {
"type": "tar",
"url": "https://catchid.com/libraries/catchid-php.tar.gz"
}
}
}
]
And run from the command line
composer require catchid/catchid
Usage
use CatchId\CatchId;
$catchId = new CatchId(['token' => <api_key>]);
$catchId->creditInfo();
$catchId->findUIds([
"https://www.facebook.com/profile.php?id=1234567890",
"https://www.linkedin.com/in/test-user-1234567890/"
]);
$uIdsInfo = $catchId->showUIds([
"d458996c-d417-46de-8c37-417c0a4372b0",
"aa47efc0-406e-4fb7-9e4c-335dd328bc3e"
]);
$linkedInAttrs = $catchId->getLinkedInAttrs( "https://www.linkedin.com/in/test-user-1234567890/");
Download library
For UserAPI usage, it is necessary to generate an API key in your profile settings.
Query headers must contain
Content-Type: application/json Authorization: Token api_key
{ "data": [ "d458996c-d417-46de-8c37-417c0a4372b0", "aa47efc0-406e-4fb7-9e4c-335dd328bc3e", ] }
{ "data": [ { "uid": "d458996c-d417-46de-8c37-417c0a4372b0", "type": "email", "contact": "xxx46@xxx.com" }, { "uid": "aa47efc0-406e-4fb7-9e4c-335dd328bc3e", "type": "phone", "contact": "+71231234567" } ], "credits": { "credits":775 } }
{ "credits": { "credits": 778 } }
{ "data":[ "https://www.facebook.com/profile.php?id=1234567890", "https://www.linkedin.com/in/test-user-1234567890/", "https://vk.com/test", "https://www.instagram.com/testuser/", "https://incorrect.com/123", "+79961234567", "linkedin:228" // linkedin с profile id 228 ] }
{ "data": [ { "query": "https://www.facebook.com/profile.php?id=1234567890", "contacts": [ { "uid": "6cb63c41-c4ec-4721-b89f-22119159a870", "type": "email" } ] }, { "query": "https://www.linkedin.com/in/test-user-1234567890/", "contacts": [ { "uid": "e150b51e-055b-4d82-9670-5611872c3f44", "type": "phone" } ] }, { "query": "https://vk.com/test", "contacts": [] }, { "query": "https://www.instagram.com/testuser/", "contacts": [] }, { "query": "+79961234567", "contacts": [] }, ], "incorrect": ["https://incorrect.com/123"], "credits": { "credits": 778 } }
The data field in this response has queries and contacts where:
The credits field - user balance information.
incorrect - a list with contacts that are not recognized.
{ "errors": [ "You have exceeded the maximum amount of queries" ], "error_code": 1422 }
{ "errors": [ "Your email isn't confirmed" ] }
{ "errors": [ "Unauthorized" ], "error_code": 1401 }
{ "errors": [ "You have insufficient credits" ], "error_code": 1402, "credits": { "credits": 0 } }
Sign in using your email
Or one of social networks down below
By signing in, I agree to the Terms Of Use
Sign in with social networks
By signing up, I agree to the Terms Of Use