API Documentation
Complete reference for Qaranly public API and Agent API.
Authentication
Public API (v1)
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYAgent API
Include your agent API key in the x-agent-api-key header:
x-agent-api-key: qrn_your_api_key_hereAPI Key Scopes
agent:read- Read access to all contentagent:write- Create and update contentagent:delete- Delete contentadmin- Full access including users and config
Recommended: create one dedicated Openclaw key per automation job, keep it server-side only, and grant the smallest scope set possible. Add an IP allowlist and expiry date when you can.
Public API (v1)
Base URL: https://qaranly.com/api/v1
Rate limit: 60 req/min, 10,000 req/day.
/api/v1/toolsscope: readList tools with filtering and pagination.
Query params: category, search, featured, limit, offset, locale
/api/v1/tools/[slug]scope: readGet a single tool by its slug.
Query params: locale
/api/v1/categoriesscope: readList all tool categories.
Query params: locale
Agent API
Full content management API for automated agents. Base URL: https://qaranly.com/api/agent
المدونة
/api/agent/blogscope: agent:readList blog posts with pagination.
Query params: page, limit, published
/api/agent/blogscope: agent:writeCreate or upsert a blog post.
{
"slug": "my-post",
"published": true,
"authorId": "uuid",
"translations": {
"ar": {
"title": "عنوان المقال",
"excerpt": "ملخص قصير",
"content": "محتوى المقال الكامل",
"metaTitle": "عنوان SEO",
"metaDescription": "وصف SEO"
}
}
}/api/agent/blogscope: agent:writeUpdate an existing blog post by slug.
{ "slug": "my-post", "translations": { "ar": { "title": "..." } } }/api/agent/blog?slug=my-postscope: agent:deleteDelete a blog post by slug.
الأخبار
/api/agent/newsscope: agent:readList news articles.
Query params: page, limit
/api/agent/newsscope: agent:writeCreate or upsert a news article.
{
"slug": "news-slug",
"source": "Source Name",
"sourceUrl": "https://...",
"imageUrl": "https://...",
"titleAr": "عنوان الخبر",
"excerptAr": "ملخص",
"contentAr": "المحتوى",
"publishedAt": "2024-01-01T00:00:00Z"
}/api/agent/newsscope: agent:writeUpdate a news article by slug.
/api/agent/news?slug=news-slugscope: agent:deleteDelete a news article.
الأدوات
/api/agent/toolsscope: agent:readList all tools (admin view).
Query params: page, limit
/api/agent/toolsscope: agent:writeCreate or upsert a tool.
{
"slug": "tool-slug",
"websiteUrl": "https://...",
"pricingType": "free|freemium|paid",
"translations": {
"ar": {
"name": "اسم الأداة",
"shortDescription": "وصف قصير",
"fullContent": "وصف كامل"
}
},
"categoryIds": ["uuid1", "uuid2"],
"imageUrl": "https://...",
"isVerified": false
}/api/agent/toolsscope: agent:writeUpdate a tool by slug.
/api/agent/tools?slug=tool-slugscope: agent:deleteSoft-delete a tool.
الفئات
/api/agent/categoriesscope: agent:readList all categories.
/api/agent/categoriesscope: agent:writeCreate a new category.
{ "slug": "cat-slug", "iconName": "Brain", "translations": { "ar": "اسم التصنيف" } }/api/agent/categoriesscope: agent:writeUpdate a category.
/api/agent/categories?slug=cat-slugscope: agent:deleteDelete a category.
الأدلة
/api/agent/guidesscope: agent:readList published guides.
/api/agent/guidesscope: agent:writeCreate a guide.
{
"slug": "guide-slug",
"guideType": "getting-started",
"featured": false,
"readingTimeMinutes": 10,
"published": true,
"translations": {
"ar": {
"title": "...", "description": "...",
"content": "...", "excerpt": "..."
}
}
}/api/agent/guidesscope: agent:writeUpdate a guide.
/api/agent/guides?slug=guide-slugscope: agent:deleteDelete a guide.
المصطلحات
/api/agent/glossaryscope: agent:readList glossary terms.
/api/agent/glossaryscope: agent:writeCreate a glossary term.
{ "slug": "term-slug", "translations": { "ar": { "term": "المصطلح", "definition": "التعريف", "examples": ["مثال 1"] } } }/api/agent/glossary?slug=term-slugscope: agent:deleteDelete a glossary term.
الإحصاءات والإعدادات
/api/agent/statsscope: agent:readGet site statistics (tool count, user count, blog count, news count).
/api/agent/usersscope: adminList registered users (admin only).
Query params: page, limit
/api/agent/configscope: agent:readGet site configuration and content counts.
مسار Openclaw
Use the /api/agent/* endpoints directly from Openclaw to create or update tools, blog posts, news items, prompts, and categories without a separate manual publishing queue.
المسار الموصى به
- 1. تحقّق من المصدر وطبّع البيانات قبل الإرسال.
- 2. استدعِ نقطة النهاية المناسبة باستخدام
x-agent-api-key. - 3. اترك واجهة البرمجة تعيد التحقق من ذاكرة المحتوى تلقائيًا.
- 4. سجّل العملية داخل تتبع وكيلك لأغراض المراجعة.
import { createOpenclawClient } from '@/lib/openclaw';
const client = createOpenclawClient({
apiKey: process.env.OPENCLAW_AGENT_API_KEY!,
});
await client.upsertTool({
slug: 'new-tool',
websiteUrl: 'https://example.com',
pricingType: 'freemium',
translations: {
ar: {
name: 'اسم الأداة',
shortDescription: 'وصف قصير',
fullContent: 'وصف كامل'
}
},
categoryIds: ['category-id'],
});The helper in lib/openclaw.ts keeps the contract in one place so the agent can publish blog posts, news, prompts, and tools consistently.
Getting Started
1. Sign in to your account and visit the Dashboard.
2. Open API Keys from an admin account and create a dedicated key for Openclaw. Do not reuse a global admin key.
3. Give it only the scopes it needs, ideally agent:read and agent:write.
4. Add agent:delete only if the bot truly needs deletion support.
5. Use an IP allowlist and expiry date if your deployment setup allows it.
6. Use the API key in the x-agent-api-key header for all Agent API requests.
7. The API key is shown only once on creation. Store it securely.
8. For a reusable client, import createOpenclawClient from lib/openclaw.ts.
Error Responses
401 - Missing or invalid API key
403 - Insufficient scope for this operation
400 - Invalid request body (validation error)
404 - Resource not found
500 - Internal server error