API Documentation

Integrate AI Tools Hub data into your applications with our RESTful API

Quick Start

1. Get Your API Key

Sign up for a premium account to receive your API key.

X-API-Key: your-api-key-here
2. Make Your First Request

Fetch the latest AI tools with a simple GET request.

GET https://aitoolshub.app/api/v1/tools

Base URL

https://aitoolshub.app/api/v1

All API requests should be made to this base URL with the appropriate endpoint.

Authentication

Include your API key in the request headers:

curl -H "X-API-Key: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     https://aitoolshub.app/api/v1/tools
Keep your API key secure. Never expose it in client-side code.

API Endpoints

Get All Tools
GET
/api/v1/tools

Retrieve a list of all AI tools in the database.

Query Parameters
Parameter Type Description Default
category string Filter by category all
limit integer Number of results to return 50
offset integer Number of results to skip 0
sort string Sort by: name, rating, date_added date_added
Example Request
GET /api/v1/tools?category=content&limit=10&sort=rating
Example Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "ChatGPT",
      "description": "Advanced conversational AI platform",
      "category": "Content Creation",
      "usefulness_score": 9,
      "use_case": "Text generation and analysis",
      "link": "https://openai.com/chatgpt",
      "source": "ProductHunt",
      "date_added": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "total": 51,
    "limit": 10,
    "offset": 0,
    "has_more": true
  }
}
Get Tool by ID
GET
/api/v1/tools/{id}

Retrieve detailed information about a specific tool.

Example Request
GET /api/v1/tools/1
Example Response
{
  "success": true,
  "data": {
    "id": 1,
    "name": "ChatGPT",
    "description": "Advanced conversational AI platform for content creation",
    "category": "Content Creation",
    "usefulness_score": 9,
    "use_case": "Text generation, analysis, creative writing",
    "link": "https://openai.com/chatgpt",
    "original_link": "https://producthunt.com/posts/chatgpt",
    "source": "ProductHunt",
    "date_added": "2024-01-15T10:30:00Z",
    "metadata": {
      "pricing": "freemium",
      "enterprise_ready": true,
      "api_available": true
    }
  }
}
Search Tools
GET
/api/v1/tools/search

Search tools by name, description, or use case.

Query Parameters
Parameter Type Description Required
q string Search query Yes
fields string Fields to search: name, description, use_case No
Example Request
GET /api/v1/tools/search?q=content%20creation&fields=name,description
Get Categories
GET
/api/v1/categories

Get all available tool categories with counts.

Example Response
{
  "success": true,
  "data": [
    {
      "name": "Content Creation",
      "count": 15,
      "description": "Tools for writing, editing, and content generation"
    },
    {
      "name": "Business Intelligence",
      "count": 8,
      "description": "Data analysis and business analytics tools"
    }
  ]
}
Get Analytics
Premium
/api/v1/analytics/tools

Get detailed analytics about tool usage and trends.

Example Response
{
  "success": true,
  "data": {
    "total_tools": 51,
    "categories": 9,
    "average_rating": 7.8,
    "growth_rate": "15% monthly",
    "trending_categories": [
      {
        "category": "Audio AI",
        "growth": 180
      }
    ]
  }
}

Error Codes

Code Description Example Response
400 Bad Request {"success": false, "error": "Invalid query parameter"}
401 Unauthorized {"success": false, "error": "Invalid API key"}
403 Forbidden {"success": false, "error": "Premium feature requires upgrade"}
404 Not Found {"success": false, "error": "Tool not found"}
429 Rate Limited {"success": false, "error": "Rate limit exceeded"}
500 Server Error {"success": false, "error": "Internal server error"}

Rate Limits

Free Tier
100 requests/hour Basic endpoints only
Premium
5,000 requests/hour All endpoints + analytics
Rate limit headers are included in all responses: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

SDK Examples

JavaScript
const api = 'https://aitoolshub.app/api/v1';
const apiKey = 'your-api-key';

fetch(`${api}/tools`, {
  headers: {
    'X-API-Key': apiKey
  }
})
.then(res => res.json())
.then(data => console.log(data));
Python
import requests

api_key = "your-api-key"
headers = {"X-API-Key": api_key}

response = requests.get(
    "https://aitoolshub.app/api/v1/tools",
    headers=headers
)

tools = response.json()
PHP
$apiKey = 'your-api-key';
$headers = [
    'X-API-Key: ' . $apiKey
];

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 
    'https://aitoolshub.app/api/v1/tools');
curl_setopt($curl, CURLOPT_HTTPHEADER, 
    $headers);

$response = curl_exec($curl);