RankForge API Documentation & Testing

Documentation

Overview

RankForge is a production-ready API-only service that generates 5,000-6,000 word SEO + AEO + GEO optimized articles in ≤5 minutes that rank #1 on Google.

Architecture

The system uses a two-step asynchronous process:

  1. Client calls POST /api/v1/generate to queue a job.
  2. QStash delivers the job to POST /api/internal/process-job for processing.
  3. Client polls GET /api/v1/jobs/[id] for status and results.
graph TD
    A[Client POST /api/v1/generate] --> B[Validate Input & Rate Limit]
    B --> C[Create Job in Supabase]
    C --> D[Enqueue to QStash]
    D --> E[Return 202 + jobId]

    Q[QStash Delivers] --> F[POST /api/internal/process-job]
    F --> G[Run Pipeline Orchestrator]
    G --> H[Phase 1: SERP DataForSEO]
    H --> I[Phase 2: Crawl Bright Data]
    I --> J[Phase 3: N-grams Analysis]
    J --> K[Phase 4: Brief Gemini Flash]
    K --> L[Phase 5: Write Sections Parallel]
    L --> M[Phase 6: Fetch Images Parallel]
    M --> N[Phase 7: Internal Links]
    N --> O[Phase 8: Assemble HTML]
    O --> P[Phase 9: QA Validation]
    P --> Q[Phase 10: Finalize & Store]
    Q --> R[Update Supabase Status/Result]

    S[Client GET /api/v1/jobs/[id]] --> T[Fetch Status/Progress/Result from Supabase]

    U[External APIs: DataForSEO, Bright Data, Gemini] -.-> G
    V[Cache: Redis] -.-> G
    W[DB: Supabase] -.-> C
    W -.-> R
    W -.-> T
    X[Storage: Supabase Bucket] -.-> Q

Note: You will need a Mermaid diagram renderer to see the above graph.

📚 Complete API Reference Available

The API has 22 strictly required fields, 14 fields with defaults, and ~11 optional fields (~47 total parameters). For comprehensive documentation including all fields, validation rules, and complete cURL examples, see:

📖 Documentation File: docs/API-REFERENCE.md

Includes: Minimal cURL Example | Full-Featured cURL Example | Complete Field Reference | Error Response Examples

Endpoints

POST /api/v1/generate

Queues a new article generation job.

Response (202 Accepted):

{
  "jobId": "uuid",
  "status": "queued",
  "message": "Job queued for processing. Poll /api/v1/jobs/{jobId} for status.",
  "estimatedCompletionTime": "YYYY-MM-DDTHH:mm:ss.sssZ"
}

GET /api/v1/jobs/[id]

Gets the status and progress of a job.

Response (200 OK):

{
  "jobId": "uuid",
  "status": "completed",
  "progress": 100,
  "createdAt": "YYYY-MM-DDTHH:mm:ss.sssZ",
  "updatedAt": "YYYY-MM-DDTHH:mm:ss.sssZ",
  "completedAt": "YYYY-MM-DDTHH:mm:ss.sssZ"
}

GET /api/v1/jobs/[id]/result

Gets the result of a completed job.

Response (200 OK):

{
  "jobId": "uuid",
  "result": {
    // Full GeneratedArticle object
  },
  "completedAt": "YYYY-MM-DDTHH:mm:ss.sssZ"
}

API Field Reference (Request)

The API has 22 strictly required fields (validation fails without them), 14 fields with defaults (optional to provide), and ~11 purely optional fields.

Required Fields (22 fields - must be provided)

FieldTypeDescription
session_idstringUnique session identifier for rate limiting
primaryKeywordstringMain keyword for article generation
wordCountnumberTarget word count (1000-15000)
contentTypestringArticle type: guide, listicle, comparison, howto, review, pillar
tonestringWriting tone: professional, casual, technical, friendly, authoritative
targetAudiencestringTarget audience description
readingLevelstringReading level: elementary, high-school, college, professional
targetSearchIntentstringSearch intent: informational, commercial, transactional
languagestringContent language (default: en)
target_countrystringTarget country (default: US)
DataForSEO_Location_CodestringDataForSEO location code
DataForSEO_Language_CodestringDataForSEO language code
client_namestringClient company name
client_websitestringClient website URL
client_descriptionstringClient business description
client_icpstringClient ideal customer profile
author_namestringArticle author name
author_titlestringAuthor professional title
schemaTypestringSchema.org type: Article, HowTo, FAQPage, Review, Product
brandColorstringBrand color in hex format
sitemapURLstringClient sitemap URL
blogRootURLstringClient blog root URL
aeoobjectAEO configuration object (has internal defaults)

Fields with Defaults (14 fields - optional to provide)

FieldTypeDescriptionDefault
numImagesnumberNumber of images to include (0-50)0
addInfographicsbooleanInclude infographic imagesfalse
includeFaqbooleanInclude FAQ sectionfalse
includeTablesbooleanInclude data tablesfalse
includeStatisticsbooleanInclude statistical datafalse
includeExpertQuotesbooleanInclude expert quotationsfalse
includeReferencesbooleanInclude references sectionfalse
addYoutubeVideobooleanInclude YouTube videosfalse
addEmojisbooleanInclude emojis in contentfalse
addCTAbooleanInclude call-to-actionfalse
ctaPlacementstringCTA placement: top, bottom, both, inline, multiple, nonenone
addExternalLinkbooleanInclude external linksfalse
externalLinksCountnumberNumber of external links (0-100)0
internalLinksNumbernumberNumber of internal links (0-100)3
tocPlacementstringTable of contents placement: top, sidebar, floating, nonenone

Purely Optional Fields (~11 fields)

FieldTypeDescriptionDefault
seedKeywordstringSecondary keyword for SERP research-
longTailKeywordstringLong-tail keyword variation-
focusKeyphrasesstring[]Additional keyphrases to target-
subTopicsstring[]Article subtopics (auto-derived if omitted)-
author_biostringAuthor biography (boosts E-A-T)-
author_credentialsstringAuthor credentials-
imageStylestringImage style description-
youtubeVideoUrlstringSpecific YouTube video URL-
youtubeSearchQuerystringYouTube search query-
youtubeVideoCountnumberNumber of YouTube videos (1-10)-
emojiDensitystringEmoji density: light, moderate, heavy-
ctaTextstringCTA button text-
ctaUrlstringCTA destination URL-
externalLinkDomainsstring[]Preferred external domains-
externalLinkstringSpecific external link URL-
mustIncludeSectionsstring[]Required section titles-
excludeTopicsstring[]Topics to avoid-
metaDescriptionGuidelinesstringMeta description instructions-
globalArticleInstructionsstringGeneral writing instructions-
bestArticleExampleOnestringExample article URL 1-
bestArticleExampleTwostringExample article URL 2-
bestArticleExampleThreestringExample article URL 3-
competitorUrlsstring[]Competitor analysis URLs-

cURL Examples

Minimal Request (Required Fields Only)

curl -X POST https://your-domain.com/api/v1/generate \
 -H "Content-Type: application/json" \
 -d '{
   "session_id": "your-session-id",
   "primaryKeyword": "your keyword",
   "wordCount": 5000,
   "contentType": "guide",
   "tone": "professional",
   "targetAudience": "business owners",
   "readingLevel": "college",
   "targetSearchIntent": "informational",
   "language": "en",
   "target_country": "US",
   "DataForSEO_Location_Code": "2840",
   "DataForSEO_Language_Code": "en",
   "client_name": "Your Company",
   "client_website": "https://yourcompany.com",
   "client_description": "Your company description",
   "client_icp": "Your ideal customer profile",
   "author_name": "John Doe",
   "author_title": "SEO Specialist",
   "numImages": 5,
   "tocPlacement": "top",
   "schemaType": "Article",
   "brandColor": "#007bff",
   "sitemapURL": "https://yourcompany.com/sitemap.xml",
   "blogRootURL": "https://yourcompany.com/blog"
 }'

Full Request (All Optional Fields)

curl -X POST https://your-domain.com/api/v1/generate \
 -H "Content-Type: application/json" \
 -d '{
   "session_id": "your-session-id",
   "primaryKeyword": "your keyword",
   "seedKeyword": "secondary keyword",
   "longTailKeyword": "long tail keyword",
   "focusKeyphrases": ["keyphrase1", "keyphrase2"],
   "subTopics": ["topic1", "topic2"],
   "wordCount": 5000,
   "contentType": "guide",
   "tone": "professional",
   "targetAudience": "business owners",
   "readingLevel": "college",
   "targetSearchIntent": "informational",
   "language": "en",
   "target_country": "US",
   "DataForSEO_Location_Code": "2840",
   "DataForSEO_Language_Code": "en",
   "client_name": "Your Company",
   "client_website": "https://yourcompany.com",
   "client_description": "Your company description",
   "client_icp": "Your ideal customer profile",
   "author_name": "John Doe",
   "author_title": "SEO Specialist",
   "author_bio": "Author bio",
   "author_credentials": "PhD in Marketing",
   "numImages": 5,
   "imageStyle": "professional",
   "addInfographics": true,
   "includeFaq": true,
   "includeTables": true,
   "includeStatistics": true,
   "includeExpertQuotes": true,
   "includeReferences": true,
   "addYoutubeVideo": true,
   "youtubeVideoUrl": "https://youtube.com/watch?v=123",
   "youtubeSearchQuery": "your search",
   "youtubeVideoCount": 2,
   "addEmojis": true,
   "emojiDensity": "moderate",
   "addCTA": true,
   "ctaText": "Contact Us",
   "ctaUrl": "https://yourcompany.com/contact",
   "ctaPlacement": "bottom",
   "addExternalLink": true,
   "externalLinksCount": 3,
   "externalLinkDomains": ["example.com"],
   "externalLink": "https://example.com",
   "internalLinksNumber": 5,
   "tocPlacement": "top",
   "mustIncludeSections": ["Introduction", "Conclusion"],
   "excludeTopics": ["topic to avoid"],
   "schemaType": "Article",
   "metaDescriptionGuidelines": "Meta description instructions",
   "aeo": {
     "enableAIOBox": true,
     "faqCount": 5
   },
   "brandColor": "#007bff",
   "sitemapURL": "https://yourcompany.com/sitemap.xml",
   "blogRootURL": "https://yourcompany.com/blog",
   "globalArticleInstructions": "General instructions",
   "bestArticleExampleOne": "https://example.com/article1",
   "bestArticleExampleTwo": "https://example.com/article2",
   "bestArticleExampleThree": "https://example.com/article3",
   "competitorUrls": ["https://competitor.com"]
 }'

🗄️ Neon Database Fields (API Response)

These are the fields returned by the API that you should save in your Neon PostgreSQL database for your frontend.

Primary Fields (Recommended - 15 fields)

FieldTypeDescription
slugstringURL-friendly identifier
seo_titlestring50-60 char title for H1 and title tag
snippet_introstring40-55 words featured snippet text
meta_descriptionstring140-160 chars for meta tag
article_htmltextClean semantic HTML content
hero_imagejsonb{url, width, height, alt} or null
authorjsonb{name, slug, role, bio?, credentials?, social_links[]}
date_publishedtimestampISO 8601 publish date
date_modifiedtimestampISO 8601 last modified (optional)
reading_timeintegerMinutes to read
word_countintegerTotal word count
content_hashstringFor deduplication
schemajsonbArticle schema.org JSON-LD
schema_faqjsonbFAQ schema.org JSON-LD (if FAQ enabled)
imagesjsonb[]Array of image objects

Optional/Extended Fields (17 fields)

FieldTypeDescription
htmltextLegacy HTML with inline styles
clean_htmltextClean HTML without styles
plain_texttextPlain text version
sectionsjsonb[]Individual section data
table_of_contentsjsonb[]TOC structure
faqjsonb[]FAQ Q&A pairs
key_takeawaystext[]Bullet points for snippets
aio_boxjsonbAI Overview optimized content
videosjsonb[]YouTube embeds
internal_linksjsonb[]Internal link data
external_linksjsonb[]External link data
metricsjsonbQuality metrics object
processing_timeintegerMilliseconds to generate
generated_attimestampWhen article was created

🚀 v2 Pipeline — POST /api/v2/generate

The v2 endpoint uses a 4-Burst Parallel Architecture that generates articles in ~2.5-3.5 minutes (vs v1's ~5-6 min). It accepts the same payload as v1 plus additional fields for EEAT, GEO, and advanced schema optimization. The Get Status tab works for both v1 and v2 jobs — they use the same Supabase job storage.

v2 Architecture: 4-Burst Pipeline

BurstNameDurationTasks
1Data Vacuum~45-50sSERP + Web Crawl + Client Intel + Stat Extraction (all parallel)
2Master Contract~30-40sN-grams → Enhanced Brief (sequential)
3Massive Fan-Out~60-90sSection Writer + Media + FAQ + Links + Schema (5 parallel workers)
4Instant Assembly~20-30sAssembly → QA → Finalize

v2-Only Fields (all optional with defaults)

FieldTypeDefaultDescription
author_linkedin_urlstring (URL)LinkedIn URL → sameAs in Person schema
author_alma_materstringUniversity → alumniOf in Person schema
author_knows_aboutstring[]Topics → knowsAbout in schema
enableStatExtractionbooleantrueExtract citeable stats (GEO pillar)
enableEEATParagraphsbooleantrueFirst-hand experience paragraphs
enableAdvancedSchemabooleantrueNested @graph JSON-LD schema
enableAIMetaTagsbooleantrueAI-generated SEO title, meta, OG tags
organization_logo_urlstring (URL)Logo for Organization schema
organization_founding_datestringFounding date for Organization schema
canonical_urlstring (URL)Canonical URL for the article

v1 vs v2 Comparison

Featurev1v2
Pipeline10-phase sequential4-burst parallel
Speed~5-6 minutes~2.5-3.5 minutes
SchemaSingle typeNested @graph (Article + Person + Org + WebPage)
GEOAuto-extracted citeable statistics
EEATBasic author fieldsLinkedIn, alumniOf, knowsAbout in schema
Meta TagsRule-basedAI-generated (Gemini) title, description, OG
Result JSON30+ fieldsAll v1 + schemaGraph + ogTags + statisticsUsed