Base URL
All API requests are made to:
https://api.agntdata.dev/v1
Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Request Structure
GET Requests
Most data retrieval endpoints use GET requests with query parameters:
GET /v1/{platform}/{operation}?param1=value1¶m2=value2
Example:
curl -X GET "https://api.agntdata.dev/v1/linkedin/get-company-details?username=microsoft" \
-H "Authorization: Bearer YOUR_API_KEY"
POST Requests
Some endpoints accept POST requests with JSON bodies for complex queries:
POST /v1/{platform}/{operation}
Content-Type: application/json
{
"param1": "value1",
"param2": "value2"
}
Common Parameters
Identifiers
Most endpoints accept one or more identifier parameters:
| Parameter | Description | Example |
|---|
username | Public username/handle | microsoft, @mkbhd |
id | Platform-specific ID | 123456789 |
url | Full profile/content URL | https://linkedin.com/company/microsoft |
The available identifiers vary by platform and endpoint. Check the API reference for each endpoint’s supported parameters.
For list endpoints, use pagination parameters:
| Parameter | Description | Default |
|---|
limit | Number of results to return | 20 |
cursor | Pagination cursor from previous response | — |
Filtering
Some endpoints support filtering:
| Parameter | Description |
|---|
since | Return results after this date (ISO 8601) |
until | Return results before this date (ISO 8601) |
sort | Sort order (recent, popular, etc.) |
Request Examples
LinkedIn Company Details
curl -X GET "https://api.agntdata.dev/v1/linkedin/get-company-details?username=microsoft" \
-H "Authorization: Bearer YOUR_API_KEY"
YouTube Channel Videos
curl -X GET "https://api.agntdata.dev/v1/youtube/get-channel-videos?username=@mkbhd&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"
X User Search
curl -X GET "https://api.agntdata.dev/v1/x/search-users?query=ai+researcher&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
# First page
curl -X GET "https://api.agntdata.dev/v1/linkedin/get-company-posts?username=microsoft&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
# Next page (using cursor from previous response)
curl -X GET "https://api.agntdata.dev/v1/linkedin/get-company-posts?username=microsoft&limit=20&cursor=abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Response Structure
Successful Response
{
"success": true,
"data": {
"id": "1035",
"name": "Microsoft",
"username": "microsoft",
"description": "We're on a mission to empower...",
"website": "https://microsoft.com",
"followerCount": 22000000,
"employeeCount": 228000
},
"meta": {
"costCents": 1,
"purchasedBalanceCents": 949,
"subscriptionRemainingCents": 500,
"cached": false,
"latencyMs": 245
}
}
List Response
{
"success": true,
"data": [
{ "id": "1", "title": "Post 1" },
{ "id": "2", "title": "Post 2" }
],
"meta": {
"costCents": 5,
"purchasedBalanceCents": 944,
"subscriptionRemainingCents": 500,
"cached": false,
"latencyMs": 312
}
}
Error Response
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Company not found with username: nonexistent"
}
}
| Header | Required | Description |
|---|
Authorization | Yes | Bearer token with your API key |
Content-Type | For POST | application/json |
| Header | Description |
|---|
Retry-After | Seconds to wait (only present when rate limited) |
SDK Examples
JavaScript/TypeScript
const response = await fetch(
'https://api.agntdata.dev/v1/linkedin/get-company-details?username=microsoft',
{
headers: {
'Authorization': `Bearer ${process.env.AGNTDATA_API_KEY}`
}
}
);
const { success, data, error } = await response.json();
if (!success) {
throw new Error(error.message);
}
console.log(data.name); // "Microsoft"
Python
import requests
import os
response = requests.get(
'https://api.agntdata.dev/v1/linkedin/get-company-details',
params={'username': 'microsoft'},
headers={'Authorization': f'Bearer {os.environ["AGNTDATA_API_KEY"]}'}
)
data = response.json()
if not data['success']:
raise Exception(data['error']['message'])
print(data['data']['name']) # "Microsoft"
Next Steps
Pagination
Learn how to handle paginated responses.
Error Handling
Handle errors gracefully.