Getting Started
Welcome to the SearchLabs API! Our RESTful API allows you to access our intelligence platform programmatically. This documentation will guide you through authentication, available endpoints, and best practices.
All API requests should be made to: https://api.searchlabs.io/v1
Quick Start
To get started with the SearchLabs API, you'll need:
- A SearchLabs account (sign up at register)
- An API key from your dashboard
- A client library or HTTP client of your choice
Authentication
SearchLabs uses API keys to authenticate requests. You can generate and manage your API keys from the dashboard.
Using Your API Key
Include your API key in the Authorization header of your requests:
curl -X GET "https://api.searchlabs.io/v1/email/search?q=example@email.com" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Never expose your API key in client-side code. Always make API requests from your backend server.
API Endpoints
SearchLabs API provides the following endpoints:
| Endpoint | Method | Description |
|---|---|---|
| /email/search | GET | Search for email intelligence |
| /breach/check | GET | Check if email was in data breaches |
| /social/lookup | GET | Find social media profiles |
| /phone/lookup | GET | Lookup phone number information |
Email Search
Search our database for information related to an email address.
Request
GET /v1/email/search?q=target@example.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Email address to search |
| sources | array | No | Filter by specific data sources |
| limit | integer | No | Maximum results (default: 100) |
Response
{
"success": true,
"data": {
"email": "target@example.com",
"exists": true,
"breaches": 12,
"profiles": [
{
"source": "LinkedIn",
"name": "John Doe",
"location": "New York, NY",
"company": "Tech Corp"
}
],
"associated_data": {
"phones": ["+1-555-0123"],
"addresses": ["123 Main St, NY"],
"usernames": ["johndoe123"]
}
}
}
Rate Limits
To ensure fair usage and service stability, API requests are rate limited based on your subscription plan:
| Plan | Requests/Minute | Requests/Day |
|---|---|---|
| Free | 10 | 1,000 |
| Pro | 100 | 50,000 |
| Enterprise | Unlimited | Unlimited |
Each API response includes headers showing your current rate limit status:
X-RateLimit-Limit: Maximum requests allowedX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Time when limit resets (Unix timestamp)
Error Handling
The SearchLabs API uses conventional HTTP response codes to indicate success or failure:
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 400 | Bad Request | Invalid parameters or malformed request |
| 401 | Unauthorized | Invalid or missing API key |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Something went wrong on our end |
Error Response Format
{
"success": false,
"error": {
"code": "invalid_parameter",
"message": "The 'q' parameter is required",
"details": {
"parameter": "q",
"expected": "string (email address)"
}
}
}
Code Examples
Python
import requests
API_KEY = "your_api_key_here"
BASE_URL = "https://api.searchlabs.io/v1"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.get(
f"{BASE_URL}/email/search",
headers=headers,
params={"q": "target@example.com"}
)
data = response.json()
print(data)
JavaScript (Node.js)
const axios = require('axios');
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://api.searchlabs.io/v1';
const searchEmail = async (email) => {
try {
const response = await axios.get(`${BASE_URL}/email/search`, {
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
params: { q: email }
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
};
searchEmail('target@example.com');
PHP