Back to Getting Started
API Reference

REST API Reference

Complete reference for the SEO Sniper REST API. Fetch your articles programmatically for any platform or integration.

Authentication

All API requests require a Bearer token in the Authorization header. Generate tokens in Settings → Integrations.

http
Authorization: Bearer sst_your_token_here

Security Note

Keep your API tokens secret. Never expose them in client-side code. Use environment variables for server-side requests.

Base URL

Your API base URL is shown when you create an API token in Settings → Integrations → API Tokens.

text
https://your-deployment.convex.site

Store this as SEOSNIPER_API_URL in your environment variables.

Endpoints

GET

/api/v1/articles

List all published articles for your site with pagination.

Query Parameters

ParameterTypeDefaultDescription
limitnumber10Number of articles (max 50)
offsetnumber0Number of articles to skip
bash
curl -X GET "https://your-convex-url.convex.site/api/v1/articles?limit=10&offset=0" \
  -H "Authorization: Bearer sst_your_token_here"
GET

/api/v1/articles/:slug

Get a single article by its slug. Returns JSON with all article fields.

Path Parameters

ParameterTypeDescription
slugstringThe article's URL slug
bash
curl -X GET "https://your-convex-url.convex.site/api/v1/articles/best-coffee-shops-austin" \
  -H "Authorization: Bearer sst_your_token_here"
GET

/api/v1/articles/:slug/html

Get a complete, standalone HTML document for the article. Perfect for static site generation - save directly as an HTML file.

Returns text/html instead of JSON. Includes full DOCTYPE, meta tags, Open Graph, and embedded styles.

bash
curl -X GET "https://your-convex-url.convex.site/api/v1/articles/best-coffee-shops-austin/html" \
  -H "Authorization: Bearer sst_your_token_here" \
  -o article.html
GET

/api/v1/sitemap

Get sitemap data for all published articles. Use this to generate your sitemap.xml file.

bash
curl -X GET "https://your-convex-url.convex.site/api/v1/sitemap" \
  -H "Authorization: Bearer sst_your_token_here"

Error Responses

All errors return JSON with an error field.

StatusErrorDescription
401
Missing or invalid Authorization headerNo Bearer token provided
401
Invalid or revoked tokenToken does not exist or was revoked
403
Token does not have read permissionToken lacks the "read" permission
404
Article not foundNo published article with that slug
json
{
  "error": "Article not found"
}

Article Object

Complete reference for the article object returned by the API.

FieldTypeDescription
idstringUnique article identifier
slugstringURL-safe slug for the article
titlestringArticle title
metaTitlestringSEO title for <title> tag
metaDescriptionstringSEO meta description
contentHtmlstringRaw HTML content (no styles)
styledContentHtmlstringHTML with applied styles (use this for rendering)
contentMarkdownstringOriginal markdown content
headingsobjectExtracted headings (h1, h2, h3 arrays)
keywordsUsedstring[]Keywords targeted in the article
publishedAtstring | nullISO 8601 publish date
wordCountnumberArticle word count
tonestringArticle tone (professional, casual, etc.)
featuredImageUrlstring | nullFeatured image URL
featuredImageAltstring | nullFeatured image alt text
blogStyleobject | nullStyle settings (template, customCss, stylingMethod)

Rate Limits

API requests are rate-limited to protect the service. Current limits:

  • 60 requests per minute per token
  • Responses are cached for 60 seconds (Cache-Control header)

If you need higher limits for your use case, please contact support.

SEO Sniper