API Documentation
Build integrations and applications using the QAFlow REST API.
Introduction
The QAFlow API provides programmatic access to our Q&A platform. You can retrieve questions, answers, users, tags, and more.
Base URL
https://qacheck.oyescripts.com/api.php
Request Format
All API requests should be made to the base URL with the endpoint path appended. For example:
GET https://qacheck.oyescripts.com/api.php/questions
Authentication
Public endpoints (reading data) don't require authentication. For write operations, you'll need an API key.
API Key Authentication
Include your API key in the request header:
Authorization: Bearer YOUR_API_KEY
Rate Limiting
To ensure fair usage, API requests are rate limited:
| Plan | Requests/Hour | Requests/Day |
|---|---|---|
| Anonymous | 60 | 500 |
| Authenticated | 300 | 5,000 |
| Premium | 1,000 | 50,000 |
Rate limit information is included in response headers:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1640000000
Error Handling
The API uses standard HTTP status codes to indicate success or failure:
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Access denied |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error |
Error Response Format
{
"error": true,
"message": "Resource not found",
"code": 404
}
Questions
Endpoints for retrieving and searching questions.
/questions
Retrieve a paginated list of questions.
Parameters
| Parameter | Type | Description |
|---|---|---|
page |
integer | Page number (default: 1) |
limit |
integer | Results per page (default: 20, max: 100) |
sort |
string | Sort by: newest, votes, views, unanswered |
tag |
string | Filter by tag slug |
category |
integer | Filter by category ID |
Example Request
GET /api.php/questions?page=1&limit=10&sort=newest
Example Response
{
"success": true,
"data": {
"questions": [
{
"id": 123,
"title": "How to implement authentication?",
"slug": "how-to-implement-authentication",
"content": "I'm trying to...",
"votes": 15,
"views": 234,
"answers_count": 3,
"has_accepted": true,
"author": {
"id": 1,
"username": "john_doe",
"avatar": "https://..."
},
"tags": ["php", "authentication"],
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"current_page": 1,
"total_pages": 50,
"total_items": 500,
"per_page": 10
}
}
}
/questions/{id}
Retrieve a single question by ID or slug.
Parameters
| Parameter | Type | Description |
|---|---|---|
id |
integer/string | Question ID or slug |
include |
string | Include related data: answers, comments |
Example Request
GET /api.php/questions/123?include=answers,comments
/search
Search questions, answers, and users.
Parameters
| Parameter | Type | Description |
|---|---|---|
q |
string | Search query (required) |
type |
string | Filter by type: questions, answers, users, all |
page |
integer | Page number |
Example Request
GET /api.php/search?q=authentication&type=questions
Answers
Endpoints for retrieving answers.
/questions/{id}/answers
Retrieve all answers for a specific question.
Parameters
| Parameter | Type | Description |
|---|---|---|
sort |
string | Sort by: votes, newest, oldest |
Example Response
{
"success": true,
"data": {
"answers": [
{
"id": 456,
"content": "You can implement...",
"votes": 10,
"is_accepted": true,
"author": {
"id": 2,
"username": "expert_user"
},
"created_at": "2024-01-15T12:00:00Z"
}
]
}
}
Users
Endpoints for retrieving user information.
/users
Retrieve a list of users.
Parameters
sort |
string | Sort by: reputation, newest, name |
page |
integer | Page number |
/users/{id}
Retrieve a user's public profile.
Example Response
{
"success": true,
"data": {
"id": 1,
"username": "john_doe",
"display_name": "John Doe",
"avatar": "https://...",
"bio": "Software developer",
"reputation": 1500,
"badges": {
"gold": 2,
"silver": 10,
"bronze": 25
},
"questions_count": 15,
"answers_count": 50,
"joined_at": "2023-01-01T00:00:00Z"
}
}
/tags
Retrieve a list of tags.
Parameters
sort |
string | Sort by: popular, name, newest |
page |
integer | Page number |
Example Response
{
"success": true,
"data": {
"tags": [
{
"id": 1,
"name": "javascript",
"slug": "javascript",
"description": "Questions about JavaScript",
"questions_count": 150
}
]
}
}
/categories
Retrieve a list of categories.
Example Response
{
"success": true,
"data": {
"categories": [
{
"id": 1,
"name": "Programming",
"slug": "programming",
"description": "General programming questions",
"questions_count": 500,
"icon": "bi-code-slash"
}
]
}
}
Need Help?
If you have questions about the API or need assistance, we're here to help.