This page can be copied as markdown and given as context to any AI coding agent along with your Huntd API key for easy implementation.
1. Get your API Key
Contact your organization administrator to get an API key. Keys follow this format:hntd_{id}_{secret}
Keep your API key secret. Never expose it in client-side code.
2. Submit a Company Lookup
Look up contacts at any company by domain:curl -X POST https://api.gethuntd.com/api/v1/external/company-lookup \
-H "Content-Type: application/json" \
-H "X-API-Key: hntd_abc12345_yoursecretkey" \
-d '{"domain": "example.com"}'
const response = await fetch('https://api.gethuntd.com/api/v1/external/company-lookup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.HUNTD_API_KEY
},
body: JSON.stringify({ domain: 'example.com' })
});
const { data } = await response.json();
console.log('Job ID:', data.job_id);
import requests
import os
response = requests.post(
'https://api.gethuntd.com/api/v1/external/company-lookup',
headers={
'Content-Type': 'application/json',
'X-API-Key': os.environ['HUNTD_API_KEY']
},
json={'domain': 'example.com'}
)
data = response.json()
print(f"Job ID: {data['data']['job_id']}")
{
"success": true,
"data": {
"job_id": "job_1705596234567_a1b2c3d4",
"domain": "example.com",
"sources": ["source_name"],
"scheduled_for": "immediate"
}
}
3. Get Results
Poll for results using the job ID:curl -X GET "https://api.gethuntd.com/api/v1/external/company-lookup/job_1705596234567_a1b2c3d4/result" \
-H "X-API-Key: hntd_abc12345_yoursecretkey"
const jobId = 'job_1705596234567_a1b2c3d4';
const result = await fetch(
`https://api.gethuntd.com/api/v1/external/company-lookup/${jobId}/result`,
{ headers: { 'X-API-Key': process.env.HUNTD_API_KEY } }
);
const data = await result.json();
console.log(data.contacts);
import requests
import os
job_id = 'job_1705596234567_a1b2c3d4'
response = requests.get(
f'https://api.gethuntd.com/api/v1/external/company-lookup/{job_id}/result',
headers={'X-API-Key': os.environ['HUNTD_API_KEY']}
)
data = response.json()
print(data['contacts'])
{
"job_id": "job_1705596234567_a1b2c3d4",
"domain": "example.com",
"source": "source_name",
"status": "success",
"contacts": [
{
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"job_title": "Senior Software Engineer",
"linkedin_url": "https://linkedin.com/in/johndoe",
"company": "Example Corp",
"company_domain": "example.com",
"verifications": [
{
"source": "source_name",
"isVerified": true
}
]
}
],
"credits_used": 1,
"created_at": "2024-01-18T12:30:00.000Z"
}
Instead of polling, you can provide a
webhook_url when submitting the lookup to receive results automatically.Example with Webhook
curl -X POST https://api.gethuntd.com/api/v1/external/company-lookup \
-H "Content-Type: application/json" \
-H "X-API-Key: hntd_abc12345_yoursecretkey" \
-d '{
"domain": "example.com",
"webhook_url": "https://yourapp.com/webhooks/huntd"
}'
const response = await fetch('https://api.gethuntd.com/api/v1/external/company-lookup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.HUNTD_API_KEY
},
body: JSON.stringify({
domain: 'example.com',
webhook_url: 'https://yourapp.com/webhooks/huntd'
})
});
const { data } = await response.json();
console.log('Job ID:', data.job_id);
// Results will be sent to your webhook URL when ready
import requests
import os
response = requests.post(
'https://api.gethuntd.com/api/v1/external/company-lookup',
headers={
'Content-Type': 'application/json',
'X-API-Key': os.environ['HUNTD_API_KEY']
},
json={
'domain': 'example.com',
'webhook_url': 'https://yourapp.com/webhooks/huntd'
}
)
data = response.json()
print(f"Job ID: {data['data']['job_id']}")
# Results will be sent to your webhook URL when ready
Next Steps
API Reference
Full API documentation
Webhooks
Set up webhook callbacks