Documentation
Everything you need to integrate TrafficNinja into your stack — REST API reference and WordPress plugin guide.
API Integration
The TrafficNinja REST API lets you programmatically manage websites, categories, themes, and sync generated articles to your platform. All endpoints are prefixed with /api/v1/.
Base URL
https://trafficninja.io/api/v1Authentication
TrafficNinja uses Bearer token authentication. Your API key is generated automatically during onboarding. Find it in your dashboard under Settings → Integration Settings.
Copy your API key from Dashboard → Settings → Integration Settings and pass it as a Bearer token in every request.
Use your API key in every request:
curl https://trafficninja.io/api/v1/websites \
-H "Authorization: Bearer {your-api-key}" \
-H "Accept: application/json"Core Endpoints
Websites
/api/v1/websitesList all websites Auth/api/v1/websitesCreate a website Auth/api/v1/websites/{id}Get a website Auth/api/v1/websites/{id}Update a website Auth/api/v1/websites/{id}Delete a website AuthPosts
/api/v1/postsList posts Auth/api/v1/posts/{id}Get post AuthOptional query filters: website_id (integer), statuses[] (published|draft|archived|deleted), title (partial match), date_from / date_to (YYYY-MM-DD)
GET /api/v1/posts?website_id=1&statuses[]=published&title=seo&date_from=2026-01-01&date_to=2026-04-30
Authorization: Bearer {your-api-key}Example: Create a website
POST /api/v1/websites
Authorization: Bearer {token}
Content-Type: application/json
{
"name": "My Blog",
"url": "https://myblog.com",
"industry": "technology",
"country": "US",
"language": "en"
}{
"id": 42,
"name": "My Blog",
"url": "https://myblog.com",
"status": "active",
"created_at": "2026-04-10T12:00:00Z"
}WordPress Plugin Endpoints
These endpoints are consumed by the WordPress plugin using a per-site WordPress API Key (generated in the dashboard). Pass it via the X-API-Key header:
X-API-Key: {your-wordpress-api-key}/api/v1/wordpress/connection-testVerify API key + connectivity/api/v1/wordpress/content-queueFetch articles ready to publish/api/v1/wordpress/content/{id}Get full article contentContent queue item shape
{
"id": 99,
"title": "10 Ways to Boost Local SEO",
"slug": "10-ways-boost-local-seo",
"content": "<h2>...</h2><p>...</p>",
"meta_description": "Learn how to dominate local search...",
"focus_keyword": "local SEO tips",
"json_ld": "{"@context":"https://schema.org",...}",
"locale": "en",
"categories": ["SEO", "Marketing"],
"scheduled_for": "2026-04-11T08:00:00Z"
}Error Handling
All errors return JSON with a consistent shape:
{
"message": "The given data was invalid.",
"errors": {
"email": ["The email field is required."]
}
}400Bad Request — validation failed401Unauthorized — missing or invalid token403Forbidden — insufficient permissions404Not Found — resource does not exist422Unprocessable Entity — business logic error429Too Many Requests — rate limited500Server Error — try again later