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

# First Extraction Request

> Create your first extraction run and retrieve structured output.

Use extraction when you want structured output instead of raw crawled content.

## Request

Node.js and Python examples use the [Bulkgrid SDKs](/docs/sdk). Set `BULKGRID_API_KEY` in your backend environment; cURL examples also use `BULKGRID_BASE_URL=https://bulkgrid.com`.

<CodeGroup>
  ```js Node.js theme={null}
  import { BulkgridClient } from '@bulkgrid/sdk';

  const client = new BulkgridClient({
    apiKey: process.env.BULKGRID_API_KEY ?? '',
    baseUrl: process.env.BULKGRID_BASE_URL ?? 'https://bulkgrid.com',
  });

  const run = await client.extract({
    urls: ['https://example.com'],
    query: 'Extract the company name and a one sentence product summary',
    schema: {
      type: 'object',
      properties: {
        companyName: { type: 'string' },
        productSummary: { type: 'string' },
      },
      required: ['companyName'],
    },
  });
  ```

  ```python Python theme={null}
  import os
  from bulkgrid import BulkgridClient

  with BulkgridClient(
      api_key=os.environ["BULKGRID_API_KEY"],
      base_url=os.environ.get("BULKGRID_BASE_URL", "https://bulkgrid.com"),
  ) as client:
      data = client.extract(
          {
              "urls": ["https://example.com"],
              "query": "Extract the company name and a one sentence product summary",
              "schema": {
                  "type": "object",
                  "properties": {
                      "companyName": {"type": "string"},
                      "productSummary": {"type": "string"},
                  },
                  "required": ["companyName"],
              },
          }
      )
      print(data)
  ```

  ```bash cURL theme={null}
  curl "$BULKGRID_BASE_URL/api/v1/extract" \
    -H 'Content-Type: application/json' \
    -H "x-api-key: $BULKGRID_API_KEY" \
    -d '{
      "type": "extract",
      "urls": [
        "https://example.com"
      ],
      "query": "Extract the company name and a one sentence product summary",
      "schema": {
        "type": "object",
        "properties": {
          "companyName": { "type": "string" },
          "productSummary": { "type": "string" }
        },
        "required": ["companyName"]
      }
    }'
  ```
</CodeGroup>

## What happens next

Bulkgrid returns a run object immediately. Extraction is asynchronous.

## Minimal response fields to store

* `id`
* `status`
* `type`
* `urls`
* `created_at`

## Next step

Poll `GET /api/v1/runs/{runId}` until the run reaches `completed`, then call `GET /api/v1/runs/{runId}/results`.

For the full workflow, read [Extraction](/docs/extraction).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.