Developer APIv1

API Reference

Automate brand extraction at scale. POST any URL and receive a complete 15-file AI-native brand kit — DESIGN.md, .cursorrules, llms.txt, CSS, Tailwind v4, Shadcn, Figma tokens, DOCX, PPTX, and PDF.

Base URL: https://styleextract.com
Bearer token auth
1 extraction / day
Get API key →

Overview

The StyleExtract API lets you programmatically extract a brand's complete visual identity from any public URL. A single POST request visits the URL with a real Chromium browser, extracts colors, fonts, logo, spacing tokens, and design system data — then generates 15 ready-to-use files for AI coding agents, design tools, and developer workflows.

AI-Native Files

DESIGN.md, AGENTS.md, .cursorrules, brand.mdc, llms.txt, SPEC.md — drop any into your repo root and every AI coding agent is on-brand.

Code Exports

CSS variables, Tailwind v3/v4, Shadcn theme, Figma tokens — paste directly into your codebase.

Documents

Branded DOCX, PPTX, and a 17-page PDF brand book — for agency handoffs and stakeholder presentations.

Authentication

All API requests require a bearer token. API keys start with sk_style_ and are generated in your API Dashboard after subscribing. Keys are shown only once — store them securely. You can create multiple keys and revoke them individually.

http
Authorization: Bearer sk_style_4a8f2b9c1d3e7f6a...

Never expose your API key in client-side code. All requests must originate from your server.

Quickstart

Extract a brand in one request. The response includes the extraction data and direct download URLs for all 15 files.

1. Extract a brand

curl
curl -X POST https://styleextract.com/api/v1/extract \
  -H "Authorization: Bearer sk_style_..." \
  -H "Content-Type: application/json" \
  -d '{"url": "https://stripe.com"}'

2. Response — extraction + 15 file URLs

json
{
  "id": 142,
  "url": "https://stripe.com",
  "domain": "stripe.com",
  "colors": ["#533afd", "#061b31", "#ff6118", "#50617a"],
  "fonts": ["sohne-var", "Inter"],
  "logoUrl": "https://...",
  "isPaid": true,
  "files": {
    "DESIGN.md":          "https://styleextract.com/api/export/design-md?file=design&id=142",
    "AGENTS.md":          "https://styleextract.com/api/export/design-md?file=agents&id=142",
    ".cursorrules":       "https://styleextract.com/api/export/design-md?file=cursorrules&id=142",
    "brand.mdc":          "https://styleextract.com/api/export/design-md?file=mdc&id=142",
    "llms.txt":           "https://styleextract.com/api/export/design-md?file=llms&id=142",
    "SPEC.md":            "https://styleextract.com/api/export/design-md?file=spec&id=142",
    "scaffold.html":      "https://styleextract.com/api/export/design-md?file=html&id=142",
    "variables.css":      "https://styleextract.com/api/export/css?id=142",
    "tailwind.config.js": "https://styleextract.com/api/export/tailwind?id=142",
    "tailwind-v4.css":    "https://styleextract.com/api/export/tailwind-v4?id=142",
    "shadcn.css":         "https://styleextract.com/api/export/shadcn?id=142",
    "figma-tokens.json":  "https://styleextract.com/api/export/tokens?format=figma&id=142",
    "tokens.json":        "https://styleextract.com/api/export/tokens?format=w3c&id=142",
    "brand.docx":         "https://styleextract.com/api/export/docx?id=142",
    "brand.pptx":         "https://styleextract.com/api/export/pptx?id=142",
    "brand.pdf":          "https://styleextract.com/api/export/pdf?id=142"
  },
  "createdAt": "2026-06-06T12:00:00.000Z"
}

3. Download a file

curl
curl -L -o DESIGN.md \
  "https://styleextract.com/api/export/design-md?file=design&id=142" \
  -H "Authorization: Bearer sk_style_..."
POST

/api/v1/extract

Scrapes a public URL with a real Chromium browser and generates a complete brand kit. This counts against your daily rate limit. Processing takes 5–20 seconds depending on the site's complexity.

Request body

ParameterTypeRequiredDescription
urlstringrequiredThe public URL to extract from. Must be http:// or https://. Protocol optional — will default to https://.
selectorstringoptionalCSS selector for component-level extraction. When provided, computed styles for the matched element are captured and a component.mdc file URL is added to the files map.

Response — 201 Created

FieldTypeDescription
idnumberExtraction ID. Use this to fetch file download URLs.
urlstringThe URL that was extracted.
domainstringCleaned hostname (e.g. stripe.com).
colorsstring[]Brand colors as hex strings, ranked by visual prominence.
fontsstring[]Font family names detected on the page.
logoUrlstring|nullURL of the detected logo image.
isPaidbooleanAlways true for API extractions.
filesobjectMap of filename → download URL. See File Reference.
createdAtstringISO 8601 timestamp.

Response headers

http
X-RateLimit-Limit: 1
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 2026-06-07
GET

/api/v1/extractions

Returns a paginated list of all paid extractions associated with your API key. Does not count against the rate limit.

Query parameters

ParamTypeDefaultDescription
limitnumber20Results per page. Max 100.
offsetnumber0Number of records to skip for pagination.

Example

curl
curl "https://styleextract.com/api/v1/extractions?limit=10&offset=0" \
  -H "Authorization: Bearer sk_style_..."

Response — 200 OK

json
{
  "data": [
    {
      "id": 142,
      "url": "https://stripe.com",
      "domain": "stripe.com",
      "colors": ["#533afd", "#061b31"],
      "fonts": ["sohne-var"],
      "logoUrl": "https://...",
      "isPaid": true,
      "createdAt": "2026-06-06T12:00:00.000Z",
      "files": {
        "DESIGN.md": "/api/export/design-md?file=design&id=142",
        "AGENTS.md": "/api/export/design-md?file=agents&id=142",
        ".cursorrules": "/api/export/design-md?file=cursorrules&id=142",
        "llms.txt": "/api/export/design-md?file=llms&id=142"
      }
    }
  ],
  "meta": {
    "total": 47,
    "limit": 10,
    "offset": 0,
    "hasMore": true
  },
  "rateLimit": {
    "used": 1,
    "limit": 1,
    "resetDate": "2026-06-07"
  }
}
GET

/api/v1/extractions/{id}

Fetch a single extraction by ID. Returns the full extraction including all 15 file download URLs. Does not count against the rate limit.

curl
curl "https://styleextract.com/api/v1/extractions/142" \
  -H "Authorization: Bearer sk_style_..."

Response shape is identical to the POST /extract response. File URLs include the full https://styleextract.com prefix.

File Reference

Every extraction generates 15 files. Download any of them by making a GET request to its URL with your API key as the bearer token.

AI Coding Agent Files

FilenameRoute paramDescription
DESIGN.mdfile=designYAML front-matter brand tokens + structured Markdown design rationale. Built to be read by Claude, Cursor, Copilot, and Bolt.new.
AGENTS.mdfile=agentsExplicit rules for AI coders: what to do, what to never do, exact color and spacing enforcement.
.cursorrulesfile=cursorrulesGlobal workspace behavioral rules for Cursor IDE. Drop in your project root.
brand.mdcfile=mdcCursor MDC format with file glob patterns — rules scoped to CSS/TSX/HTML files automatically.
llms.txtfile=llmsHigh-density stripped Markdown optimized for LLM context windows. Minimal tokens, maximum design signal.
SPEC.mdfile=specFigma-style component spec: spacing rules, border radius usage, component structure guidelines.
scaffold.htmlfile=htmlSemantic HTML scaffold with inline CSS custom properties and pre-wired brand tokens.

All 7 AI files share the same route: /api/export/design-md?{param}&id={id}

Code Exports

FilenameRouteDescription
variables.css/api/export/css?id={id}CSS custom properties (:root block) with every color and font.
tailwind.config.js/api/export/tailwind?id={id}Tailwind v3 config extending the brand palette and typography.
tailwind-v4.css/api/export/tailwind-v4?id={id}Tailwind v4 @theme block with oklch colors, spacing, and radius.
shadcn.css/api/export/shadcn?id={id}Shadcn UI theme: HSL CSS vars for light and dark mode.
figma-tokens.json/api/export/tokens?format=figma&id={id}Figma Tokens Studio plugin format with all brand tokens.
tokens.json/api/export/tokens?format=w3c&id={id}W3C Design Tokens Community Group (DTCG) format.

Documents

FilenameRouteDescription
brand.docx/api/export/docx?id={id}Branded Microsoft Word document template.
brand.pptx/api/export/pptx?id={id}17-slide brand presentation with palette, typography, and Vibe Radar.
brand.pdf/api/export/pdf?id={id}17-page whitelabeled brand book — fully styled in your brand colors.

Downloading a file

curl
# Download DESIGN.md
curl -L -o DESIGN.md \
  "https://styleextract.com/api/export/design-md?file=design&id=142" \
  -H "Authorization: Bearer sk_style_..."

# Download .cursorrules (note: no file extension in the filename)
curl -L -o .cursorrules \
  "https://styleextract.com/api/export/design-md?file=cursorrules&id=142" \
  -H "Authorization: Bearer sk_style_..."

# Download the brand PDF
curl -L -o brand.pdf \
  "https://styleextract.com/api/export/pdf?id=142" \
  -H "Authorization: Bearer sk_style_..."

Rate Limits

Each API key is allowed 1 extraction per calendar day (UTC). The limit resets at midnight UTC. Read-only endpoints (GET /extractions and GET /extractions/{id}) and file downloads are not rate-limited.

1

Extractions/day

per API key

Unlimited

Read requests

GET endpoints

Unlimited

File downloads

any format

Rate limit headers

Every response from POST /extract includes:

HeaderExampleDescription
X-RateLimit-Limit1Maximum extractions per day.
X-RateLimit-Remaining0Remaining extractions today.
X-RateLimit-Reset2026-06-07Date when the limit resets (UTC, YYYY-MM-DD).

429 — Rate limit exceeded

json
{
  "error": "Daily extraction limit reached. Rate limit: 1 extraction per calendar day (UTC).",
  "used": 1,
  "limit": 1,
  "resetDate": "2026-06-07"
}

Error Codes

All errors return JSON with an error field describing what went wrong.

StatusMeaningCommon cause
400Bad RequestMissing or invalid url field in the request body.
401UnauthorizedMissing, invalid, or revoked API key.
403ForbiddenAPI key found but lacks access to this resource.
404Not FoundExtraction ID does not exist or belongs to another user.
422Unprocessable EntityURL was reachable but returned no extractable brand data. The site may block crawlers.
429Too Many RequestsDaily extraction limit reached. Check X-RateLimit-Reset for when it resets.
503Service UnavailableScraper temporarily unavailable. Retry after a few seconds.

Error response shape

json
{
  "error": "Daily extraction limit reached. Rate limit: 1 extraction per calendar day (UTC)."
}

npx CLI

The styleextract CLI writes brand files directly into your working directory. It uses the same API under the hood — no separate package needed.

Installation

bash
# No install required — run directly with npx
npx styleextract --help

Authentication

bash
# Interactive setup — saves to ~/.styleextract/config.json
npx styleextract auth

# Or use an environment variable (CI/CD)
STYLEEXTRACT_API_KEY=sk_style_... npx styleextract init stripe.com

Extract a brand

bash
npx styleextract init stripe.com

# Writes to your current directory:
#   DESIGN.md
#   AGENTS.md
#   .cursorrules
#   .cursor/rules/brand-stripe.com.mdc
#   llms.txt
#   SPEC.md
#   brand-variables.css
#   brand-tailwind-v4.css
#   brand-tailwind.config.js
#   brand-shadcn.css
#   brand-figma-tokens.json

Commands

CommandDescription
npx styleextract init <url>Extract brand & write files to cwd
npx styleextract authSet or update your API key interactively
npx styleextract whoamiShow current API key and source

Developer API · $59.99/mo

Ready to automate brand extraction?

Subscribe to get your sk_style_... API key, then start extracting brand kits programmatically.