Struggling with integration? Need a hand with API development? Just chat with us, and Dorian will take care of everything. Easy as that!
Introduction
ContactFinder offers a powerful API that allows you to interact with the service programmatically. This guide will walk you through the basics of using the API, making Python requests, and handling responses.
API Endpoints
1. Retrieving Job List
-
URL:
https://app.contactfinder.io/api/jobs
- Method: GET
- Purpose: Fetches a list of your past searches, providing names and IDs.
2. Retrieving Job Content
-
URL:
https://app.contactfinder.io/api/job?search_id={YOUR SEARCH ID}
- Method: GET
- Purpose: Retrieves the content of a specific search using the search ID.
3. Launching a New Search
-
URL:
https://app.contactfinder.io/api/job
- Method: POST
- Purpose: Initiates a new search with specified parameters.
-
Request Body:
- Role (comma-separated list)
- Company Name (comma-separated list)
- Country Code (from Country Code API)
- Filename (optional)
- Contacts per Role (optional)
Sample Python Code
1. Fetching Job List
>> Python
import requests url = 'https://app.contactfinder.io/api/jobs' headers = {'x-api-key': 'YOUR API KEY'} response = requests.get(url, headers=headers) print(response.text)
2. Retrieving Job Content
>> Python
import requests url = 'https://app.contactfinder.io/api/job?search_id=YOUR SEARCH ID' headers = {'x-api-key': 'YOUR API KEY'} response = requests.get(url, headers=headers) print(response.text)
3. Launching a New Search
>> Python
import requests url = 'https://app.contactfinder.io/api/job' headers = { 'x-api-key': 'YOUR API KEY', 'content-type': 'application/json' } data = { "role": "RH, Devops", "company_name": "CURIUM,BIOGROUP LCD,CROMOLOGY", "lang": "FR", "filename": "First Search", # Optional "per_role": 2 # Optional } response = requests.post(url, headers=headers, json=data) print(response.text)
Handling Asynchronous Searches
Without Webhooks
If you can’t use webhooks, after initiating a search, wait for 2 minutes, then retrieve the results using the search ID.
>> Python
import requests import time url = 'https://app.contactfinder.io/api/job?search_id=YOUR SEARCH ID' headers = {'x-api-key': 'YOUR API KEY'} time.sleep(120) # Wait for 2 minutes response = requests.get(url, headers=headers) print(response.text)
With Webhooks
Webhooks provide real-time notifications. Set up your server and provide the webhook URL during the search initiation. When the search finishes, you’ll receive a notification.
Feel free to use the provided Python code snippets as a foundation for integrating ContactFinder API into your website or application. Make sure to replace placeholder values with your actual API key and search IDs.