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

# Run a scraper

> Queue a scraper run. **Asynchronous** — the call returns `202` immediately with a `runId`, so a slow page never times your request out.

Read the result with `GET /api/{scraperId}/data/{runId}`, or configure an outbound webhook to be notified when it completes.

Requires the `scraper` permission.



## OpenAPI

````yaml POST /api/scrape/{scraperId}
openapi: 3.1.0
info:
  title: ManyPI API
  description: >-
    The REST API behind ManyPI — AI lead generation, email validation,
    cold-email outreach, agent runs and web scraping. Every endpoint is
    authenticated with a ManyPI API key (`mpi_...`) or an OAuth 2.1 access
    token, and honours the permissions granted to that credential.
  version: 2.0.0
  contact:
    name: ManyPI Support
    email: support@manypi.com
    url: https://manypi.com
servers:
  - url: https://app.manypi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Leads
    description: Find, store, enrich and manage leads.
  - name: Email validation
    description: Verify that lead addresses can receive mail.
  - name: Outreach
    description: Inboxes, sequences, campaigns, sending and replies.
  - name: Agent
    description: Agent runs, replies and skills.
  - name: Scraping
    description: Scrapers, runs and extracted data.
  - name: Endpoints
    description: Publish scrapers as typed REST endpoints.
  - name: Account
    description: Key validation and account information.
paths:
  /api/scrape/{scraperId}:
    post:
      tags:
        - Scraping
      summary: Run a scraper
      description: >-
        Queue a scraper run. **Asynchronous** — the call returns `202`
        immediately with a `runId`, so a slow page never times your request out.


        Read the result with `GET /api/{scraperId}/data/{runId}`, or configure
        an outbound webhook to be notified when it completes.


        Requires the `scraper` permission.
      operationId: runScraper
      parameters:
        - name: scraperId
          in: path
          required: true
          description: Find this in the dashboard under Scrapers.
          schema:
            type: string
            format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Override the scraper's saved target for this run.
                options:
                  type: object
                  properties:
                    timeout:
                      type: integer
                    retries:
                      type: integer
            example:
              url: https://example.com/product/42
      responses:
        '202':
          description: The run was queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      runId:
                        type: string
                        format: uuid
                      status:
                        type: string
                      message:
                        type: string
                  metadata:
                    type: object
                    properties:
                      scraperId:
                        type: string
                      timestamp:
                        type: string
                        format: date-time
                      creditsRemaining:
                        type: integer
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: Out of credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such scraper for this account.
components:
  responses:
    BadRequest:
      description: The request body or parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Missing, invalid or expired credential — or a key that lacks the
        permission this route requires.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: >-
            A machine-readable code on gated failures: `lead_limit`,
            `outreach_locked`, `validation_credits_exhausted`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A ManyPI API key (`mpi_...`) from Settings → API keys, or an OAuth 2.1
        access token obtained through the MCP consent flow.

````