API Documentation
Complete reference for the FactsAI Research API
Quick Start
The FactsAI API provides AI-powered research capabilities through a simple REST interface. Get comprehensive answers with citations from across the web.
- Create an account at factsai.org
- Purchase credits from your dashboard
- Generate an API key
- Make your first request!
Authentication
All API requests require authentication via Bearer token in the Authorization header.
Header Format
Authorization: Bearer {title}_{key}
Base URL
https://deep-research-api.degodmode3-33.workers.dev
Endpoints
POST
/answer
Generate an AI-powered answer for a research query. Returns a comprehensive response with citations.
Request Body
{
"query": "What are the latest developments in quantum computing?",
"text": true // Optional: include full text in citations
}
Response
{
"success": true,
"data": {
"answer": "Recent developments in quantum computing include...",
"citations": [
{
"id": "abc123",
"url": "https://example.com/article",
"title": "Quantum Computing Advances",
"author": "Jane Doe",
"publishedDate": "2024-01-15",
"text": "Full article text...",
"image": "https://example.com/image.jpg",
"favicon": "https://example.com/favicon.ico"
}
],
"costDollars": {
"total": 0.012
}
},
"timestamp": "2024-01-20T12:00:00.000Z"
}
Cost
1 credit ($0.012) per request
Code Examples
$ cURL
curl -X POST https://deep-research-api.degodmode3-33.workers.dev/answer \
-H "Authorization: Bearer yourapp_abc123..." \
-H "Content-Type: application/json" \
-d '{"query": "What are the latest AI trends?"}'
JS Node.js
const response = await fetch('https://deep-research-api.degodmode3-33.workers.dev/answer', {
method: 'POST',
headers: {
'Authorization': 'Bearer yourapp_abc123...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'What are the latest AI trends?'
})
});
const data = await response.json();
console.log(data.data.answer);
Py Python
import requests
response = requests.post(
'https://deep-research-api.degodmode3-33.workers.dev/answer',
headers={
'Authorization': 'Bearer yourapp_abc123...',
'Content-Type': 'application/json'
},
json={
'query': 'What are the latest AI trends?'
}
)
data = response.json()
print(data['data']['answer'])
Error Codes
| Code | Status | Description |
|---|---|---|
400 |
Bad Request | Invalid request body or missing required fields |
401 |
Unauthorized | Invalid or missing API key |
402 |
Payment Required | Insufficient credits - purchase more to continue |
429 |
Too Many Requests | Rate limit exceeded - slow down |
500 |
Server Error | Internal server error - try again later |
Error Response Format
{
"success": false,
"error": "insufficient_credits",
"timestamp": "2024-01-20T12:00:00.000Z"
}
Rate Limits
- 100 requests per minute per API key
- Query length: max 1,000 characters
Pricing
$0.012
per API request (1 credit)
Bulk Packages
$12
1,000 credits
$60
5,000 credits
$120
10,000 credits