Skip to main content

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&param2=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:
ParameterDescriptionExample
usernamePublic username/handlemicrosoft, @mkbhd
idPlatform-specific ID123456789
urlFull profile/content URLhttps://linkedin.com/company/microsoft
The available identifiers vary by platform and endpoint. Check the API reference for each endpoint’s supported parameters.

Pagination

For list endpoints, use pagination parameters:
ParameterDescriptionDefault
limitNumber of results to return20
cursorPagination cursor from previous response

Filtering

Some endpoints support filtering:
ParameterDescription
sinceReturn results after this date (ISO 8601)
untilReturn results before this date (ISO 8601)
sortSort 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"
curl -X GET "https://api.agntdata.dev/v1/x/search-users?query=ai+researcher&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

With Pagination

# 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"
  }
}

Headers

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer token with your API key
Content-TypeFor POSTapplication/json

Response Headers

HeaderDescription
Retry-AfterSeconds 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.