> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tastelabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Submit your first URL and read the extracted design system

This guide takes you from zero to a complete design system in three calls.

## Prerequisites

* An API key. Create one directly in the [Engine dashboard](https://engine.tastelabs.com/app/api-keys).
* The base URL for all requests: `https://api.tastelabs.com`

Authenticate every request with your key in the `X-API-Key` header. See [Authentication](/concepts/authentication) for details.

## Extract a design system

Extraction is asynchronous: you submit a URL, then poll for the result until it finishes.

<Steps>
  <Step title="Submit a URL">
    Call [`POST /design/submissions`](/api-reference/endpoint/create-submission) with the URL. You get back a `submission_id`.
  </Step>

  <Step title="Poll for the result">
    Call [`GET /design/submissions/{id}/result`](/api-reference/endpoint/get-submission-result) until `status` is `completed` or `failed`. While the job runs you may receive a `200` with a partial `design_system`, or a `409 NOT_READY` before the first checkpoint lands.
  </Step>

  <Step title="Read the design system">
    Once `status` is `completed`, read `result.design_system`, for example `result.design_system.profile.brand_name`.
  </Step>
</Steps>

## Full example

<CodeGroup>
  ```python Python theme={null}
  import httpx
  import time

  API_KEY = "your-api-key"
  BASE = "https://api.tastelabs.com"
  HEADERS = {"X-API-Key": API_KEY}

  def extract_brand(url: str) -> dict:
      submit = httpx.post(f"{BASE}/design/submissions", headers=HEADERS, json={"url": url})
      submit.raise_for_status()
      submission_id = submit.json()["submission_id"]
      print(f"Submitted: {submission_id}")

      while True:
          r = httpx.get(f"{BASE}/design/submissions/{submission_id}/result", headers=HEADERS)
          if r.status_code == 409:
              time.sleep(3)
              continue
          r.raise_for_status()
          body = r.json()
          if body["status"] == "completed":
              return body["result"]["design_system"]
          if body["status"] == "failed":
              raise RuntimeError(body.get("error") or "Extraction failed")
          time.sleep(3)

  design_system = extract_brand("https://stripe.com")
  print(design_system["profile"]["brand_name"])
  ```

  ```typescript TypeScript theme={null}
  const API_KEY = "your-api-key";
  const BASE = "https://api.tastelabs.com";

  async function extractBrand(url: string) {
    const submit = await fetch(`${BASE}/design/submissions`, {
      method: "POST",
      headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" },
      body: JSON.stringify({ url }),
    });
    const { submission_id } = await submit.json();
    console.log(`Submitted: ${submission_id}`);

    while (true) {
      const r = await fetch(`${BASE}/design/submissions/${submission_id}/result`, {
        headers: { "X-API-Key": API_KEY },
      });
      if (r.ok) {
        const body = await r.json();
        if (body.status === "completed") return body.result.design_system;
        if (body.status === "failed") throw new Error(body.error ?? "Failed");
      }
      await new Promise((res) => setTimeout(res, 3000));
    }
  }

  const ds = await extractBrand("https://stripe.com");
  console.log(ds.profile.brand_name);
  ```

  ```bash cURL theme={null}
  export API_KEY="your-api-key"
  export BASE="https://api.tastelabs.com"

  # 1. Submit
  SUBMISSION_ID=$(curl -s -X POST $BASE/design/submissions \
    -H "X-API-Key: $API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"url": "https://stripe.com"}' | jq -r '.submission_id')

  # 2. Poll the result endpoint
  while true; do
    RESP=$(curl -s $BASE/design/submissions/$SUBMISSION_ID/result -H "X-API-Key: $API_KEY")
    STATUS=$(echo "$RESP" | jq -r '.status // empty')
    { [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ]; } && break
    sleep 3
  done

  # 3. Read the design system
  echo "$RESP" | jq '.result.design_system'
  ```
</CodeGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Extract a brand" icon="arrows-rotate" href="/concepts/submissions">
    Statuses, caching, and map mode.
  </Card>

  <Card title="The design system" icon="swatchbook" href="/concepts/design-system">
    What's inside `result.design_system`.
  </Card>

  <Card title="Find inspiration" icon="lightbulb" href="/use-cases/find-inspiration">
    No URL yet? Search the corpus for a look, then extract it.
  </Card>

  <Card title="Check brand adherence" icon="scale-balanced" href="/use-cases/brand-adherence">
    Built something from an extraction? Score it against the brand.
  </Card>
</CardGroup>
