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

User API

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

Show UIDs

POST on /userapi/v1/show
Receive contact information from UIDs by using:
{
  "data":
        [
          "d458996c-d417-46de-8c37-417c0a4372b0",
          "aa47efc0-406e-4fb7-9e4c-335dd328bc3e",
        ]
}
Here, data - UIDs that are received by Find UIDs query.

A response will look like this:

{
  "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
  }
}
The data field in this response has used UID, found contact and its type.

Credits Info

GET on /userapi/v1/users
Receive credits information by using:

A response will look like this:

{
  "credits": {
    "credits": 778
  }
}
Here credits - is the amount of credits that you can use to get this information.

Find UIDs

POST on /userapi/v1/find
Find UIDs by using:
{
  "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
  ]
}
Here, data - used contact information for search.

A response will look like this:

{
  "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:

  • query - used contact information;
  • contacts - received information ( type of contact and its UID).

The credits field - user balance information.

incorrect - a list with contacts that are not recognized.

Errors

The amount of used contacts is maxed out

422 Unprocessable Entity

{
  "errors": [
    "You have exceeded the maximum amount of queries"
  ],
  "error_code": 1422
}
                            
Account is not activated

401 Unauthorized

{
  "errors": [
    "Your email isn't confirmed"
  ]
}
                            
Incorrect API key

401 Unauthorized

{
  "errors": [
    "Unauthorized"
  ],
  "error_code": 1401
}
                            
Insufficient credits

402 Payment Required

{
  "errors": [
    "You have insufficient credits"
  ],
  "error_code": 1402,
  "credits": {
    "credits": 0
  }
}
                            

Enter your email

link to restore access will come to your e-mail