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 |
---|---|---|
success | boolean | Request success status |
data | array | Array of agent objects |
total | integer | Total number of agents |
id | string | Unique agent identifier (slug) |
name | string | Agent name |
short_description | string | Brief description of the agent |
creator | string | Company or person who created the agent |
url | string | Official website or access URL |
domains | array | Categories the agent belongs to |
use_cases | array | Primary use cases for the agent |
platform | array | Available platforms (Web, Mobile, API, etc.) |
pricing | string | Pricing model (Free, Freemium, Paid, etc.) |
underlying_model | string | AI model powering the agent |
user_feedback | string | Community 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.