Comprehensive API reference for Amkyaw.Dev Knowledge Base
The Amkyaw.Dev Knowledge Base API provides programmatic access to our comprehensive knowledge base. You can search, retrieve categories, and fetch individual knowledge items using simple RESTful endpoints.
Most endpoints are publicly accessible. For rate-limited or premium endpoints, you'll need an API key.
// Include in headers
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
To get an API key, contact us or sign up for a developer account.
All API endpoints are relative to this base URL:
https://amkyaw.dev/api/v1
API requests are rate-limited to ensure fair usage:
| Plan | Requests per minute | Requests per day |
|---|---|---|
| Public (no key) | 10 | 1,000 |
| Developer (free key) | 60 | 10,000 |
| Premium | 300 | 100,000 |
Rate limit headers are included in all responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1625097600
The API uses conventional HTTP response codes:
| Code | Description |
|---|---|
200 |
Success |
400 |
Bad Request - Invalid parameters |
401 |
Unauthorized - Invalid or missing API key |
404 |
Not Found - Resource doesn't exist |
429 |
Too Many Requests - Rate limit exceeded |
500 |
Internal Server Error |
Error response format:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later.",
"details": {
"limit": 60,
"reset": 1625097600
}
},
"timestamp": "2024-01-01T12:00:00Z"
}
/search
Search across all knowledge items with full-text search.
| Parameter | Type | Required | Description |
|---|---|---|---|
q |
string | Yes | Search query (minimum 2 characters) |
category |
string | No | Filter by category ID |
limit |
integer | No | Number of results (default: 20, max: 100) |
offset |
integer | No | Pagination offset (default: 0) |
sort |
string | No | relevance, date, popularity (default: relevance) |
curl "https://amkyaw.dev/api/v1/search?q=javascript&category=programming&limit=5"
{
"success": true,
"data": [
{
"id": "js-basics",
"title": "JavaScript Basics",
"category": "programming",
"excerpt": "Learn the fundamentals of JavaScript programming...",
"relevance": 0.95
}
],
"pagination": {
"total": 42,
"limit": 5,
"offset": 0,
"next_offset": 5
}
}
/categories
Retrieve all available categories with optional item counts.
| Parameter | Type | Description |
|---|---|---|
include_counts |
boolean | Include item count per category (default: true) |
limit |
integer | Maximum categories to return (default: 100) |
{
"success": true,
"data": [
{
"id": "general",
"name": "General Knowledge",
"description": "Common questions and answers",
"icon": "📚",
"item_count": 25,
"subcategories": ["greetings", "faq", "about"]
},
{
"id": "technical",
"name": "Technical",
"description": "Programming and technical topics",
"icon": "💻",
"item_count": 42,
"subcategories": ["programming", "api", "tools"]
}
]
}
/category/{id}
Get detailed information about a specific category.
| Parameter | Type | Description |
|---|---|---|
id |
string | Category ID (e.g., 'general', 'technical') |
| Parameter | Type | Description |
|---|---|---|
include_items |
boolean | Include items in this category (default: false) |
limit |
integer | Number of items to return (default: 50) |
curl "https://amkyaw.dev/api/v1/category/technical?include_items=true&limit=10"
/item/{id}
Retrieve a specific knowledge item by ID.
{
"success": true,
"data": {
"id": "js-closures",
"title": "JavaScript Closures Explained",
"category": "programming",
"content": "A closure is the combination of a function bundled together...",
"tags": ["javascript", "advanced", "functions"],
"metadata": {
"author": "Amkyaw",
"created": "2024-01-01",
"updated": "2024-01-15",
"views": 1234
},
"related": ["js-scope", "js-hoisting", "js-prototypes"]
}
}
/popular
Get the most viewed knowledge items.
| Parameter | Type | Description |
|---|---|---|
limit |
integer | Number of items (default: 10, max: 50) |
period |
string | day, week, month, all (default: week) |
/recent
Get the most recently added or updated items.
| Parameter | Type | Description |
|---|---|---|
limit |
integer | Number of items (default: 10, max: 50) |
/stats
Get overall knowledge base statistics.
{
"success": true,
"data": {
"total_items": 128,
"total_categories": 5,
"total_views": 15420,
"recent_additions": 12,
"popular_categories": [
{"name": "Technical", "views": 5234},
{"name": "General", "views": 4321}
],
"daily_activity": {
"2024-01-01": 234,
"2024-01-02": 345
}
}
}
/health
Check if the API is running and healthy.
{
"status": "healthy",
"timestamp": "2024-01-01T12:00:00Z",
"version": "1.0.0",
"services": {
"database": "connected",
"cache": "connected",
"external_apis": {
"github": "available",
"openai": "available"
}
}
}
/external/github/{username}
Fetch GitHub user profile and repository information.
curl "https://amkyaw.dev/api/v1/external/github/amkyaw"
/external/openai
Send prompts to OpenAI's GPT models (requires API key).
{
"prompt": "Explain JavaScript closures in simple terms",
"model": "gpt-3.5-turbo",
"max_tokens": 500,
"temperature": 0.7
}
// Search knowledge base
async function searchKnowledge(query) {
try {
const response = await fetch(
`https://amkyaw.dev/api/v1/search?q=${encodeURIComponent(query)}`
);
const data = await response.json();
return data;
} catch (error) {
console.error('Search failed:', error);
}
}
// Using our API Client
const results = await apiClient.search('javascript', {
category: 'programming',
limit: 10
});
import requests
class AmkyawAPI:
def __init__(self, base_url="https://amkyaw.dev/api/v1"):
self.base_url = base_url
def search(self, query, category=None, limit=20):
params = {'q': query, 'limit': limit}
if category:
params['category'] = category
response = requests.get(f"{self.base_url}/search", params=params)
return response.json()
def get_categories(self):
response = requests.get(f"{self.base_url}/categories")
return response.json()
# Usage
api = AmkyawAPI()
results = api.search("python programming", limit=5)
categories = api.get_categories()
# Search
curl "https://amkyaw.dev/api/v1/search?q=javascript"
# Get categories
curl "https://amkyaw.dev/api/v1/categories"
# Get specific category
curl "https://amkyaw.dev/api/v1/category/technical?include_items=true"
# Get popular items
curl "https://amkyaw.dev/api/v1/popular?limit=5"
# Health check
curl "https://amkyaw.dev/api/v1/health"
Official npm package
npm install amkyaw-api-client
const AmkyawAPI = require('amkyaw-api-client');
const api = new AmkyawAPI('YOUR_API_KEY');
Official PyPI package
pip install amkyaw-api
from amkyaw_api import Client
client = Client(api_key='YOUR_API_KEY')