API Documentation

Access our comprehensive AI agents directory programmatically through our REST API. Get real-time data about 50+ AI agents in JSON format.

Quick Start

Get all agents with a simple GET request:

curl https://top-agents.replit.app/api/agents
GET

/api/agents

Retrieve a complete list of all AI agents in the directory.

Request

curl -X GET https://top-agents.replit.app/api/agents \
  -H "Accept: application/json"

Response

{
  "success": true,
  "data": [
    {
      "id": "chatgpt",
      "name": "ChatGPT",
      "short_description": "Advanced conversational AI by OpenAI based on GPT-4/GPT-4o",
      "long_description": "ChatGPT is a state-of-the-art conversational AI...",
      "creator": "OpenAI",
      "url": "https://chat.openai.com",
      "domains": ["Tech", "General AI"],
      "use_cases": ["Conversation", "Writing", "Coding"],
      "platform": ["Web", "Mobile", "API"],
      "pricing": "Freemium",
      "underlying_model": "GPT-4/GPT-4o",
      "deployment": "Cloud",
      "legitimacy": "Official",
      "user_feedback": "Users praise ChatGPT for its natural conversation..."
    }
  ],
  "total": 56,
  "version": "1.0"
}

Response Fields

Field Type Description
successbooleanRequest success status
dataarrayArray of agent objects
totalintegerTotal number of agents
idstringUnique agent identifier (slug)
namestringAgent name
short_descriptionstringBrief description of the agent
creatorstringCompany or person who created the agent
urlstringOfficial website or access URL
domainsarrayCategories the agent belongs to
use_casesarrayPrimary use cases for the agent
platformarrayAvailable platforms (Web, Mobile, API, etc.)
pricingstringPricing model (Free, Freemium, Paid, etc.)
underlying_modelstringAI model powering the agent
user_feedbackstringCommunity feedback and reviews

Rate Limiting & Usage

Current Limits

  • • No authentication required
  • • No rate limiting currently enforced
  • • Data updated in real-time
  • • JSON response format only

Best Practices

  • • Cache responses for better performance
  • • Use appropriate HTTP headers
  • • Handle error responses gracefully
  • • Consider pagination for large datasets

Error Handling

The API returns standard HTTP status codes and error responses in JSON format.

{
  "success": false,
  "error": "Internal server error",
  "total": 0
}

HTTP Status Codes

  • 200 - Success
  • 404 - Endpoint not found
  • 500 - Internal server error

Error Fields

  • success - Always false for errors
  • error - Human-readable error message
  • total - Always 0 for errors

Code Examples

JavaScript (fetch)

fetch('https://top-agents.replit.app/api/agents')
  .then(response => response.json())
  .then(data => {
    if (data.success) {
      console.log(`Found ${data.total} agents`);
      data.data.forEach(agent => {
        console.log(`${agent.name} by ${agent.creator}`);
      });
    }
  })
  .catch(error => console.error('Error:', error));

Python (requests)

import requests

response = requests.get('https://top-agents.replit.app/api/agents')
data = response.json()

if data['success']:
    print(f"Found {data['total']} agents")
    for agent in data['data']:
        print(f"{agent['name']} by {agent['creator']}")
else:
    print(f"Error: {data['error']}")

PHP

$response = file_get_contents('https://top-agents.replit.app/api/agents');
$data = json_decode($response, true);

if ($data['success']) {
    echo "Found " . $data['total'] . " agents\n";
    foreach ($data['data'] as $agent) {
        echo $agent['name'] . " by " . $agent['creator'] . "\n";
    }
} else {
    echo "Error: " . $data['error'] . "\n";
}

Support & Feedback

Need help with the API or have suggestions for improvements? We'd love to hear from you.