Scraper

AI Scraper Response

Learn about the response structure of the AI Scraper API and how to interpret the results.

The AI Scraper API returns responses with a consistent wrapper structure across all scraping operations. While the wrapper remains the same, the data.data field contains agent-specific data optimized for each scraping type.

Standard Response Wrapper

Every API response follows this structure:

{
  "message": "Successful operation!",
  "data": {
    "id": "unique-identifier",
    "createdAt": "2026-03-06T05:30:44.642Z",
    "updatedAt": "2026-03-06T05:33:01.855Z",
    "userId": "user-id",
    "scraperId": "scraper-id",
    "type": "Rerun-AI",
    "url": "https://example.com",
    "status": "Finished",
    "error": "",
    "tokenUsage": 5,
    "data": {
      // Agent-specific data structure (see below)
    },
    "htmlPath": "...",
    "recordingPath": null,
    "screenshotPath": "...",
    "dataPath": null
  }
}

Response Fields

FieldTypeDescription
messagestringOperation status message
data.idstringUnique identifier for this scraping operation
data.createdAtstringISO 8601 timestamp when the operation started
data.updatedAtstringISO 8601 timestamp when the operation completed
data.userIdstringYour user identifier
data.scraperIdstringIdentifier of the scraper used
data.typestringAgent type used for scraping
data.urlstringTarget URL that was scraped
data.statusstringOperation status (Finished, Processing, Failed)
data.errorstringError message if the operation failed
data.tokenUsagenumberNumber of tokens consumed by this operation
data.dataobjectExtracted data (structure varies by agent type)
data.htmlPathstringPath to the saved HTML content
data.recordingPathstringPath to the scraping session recording (if available)
data.screenshotPathstringPath to the page screenshot
data.dataPathstringPath to the raw data file (if available)

Agent-Specific Response Formats

The data.data field structure varies depending on which agent you use. Each agent optimizes the data format for its specific use case.

General Agent

The General Agent provides two response formats depending on the page type you're scraping.

General Table Response Format

General agent returns a dictionary containing an array of structured items when scraping listing pages with multiple items (e.g., product listings, search results, directory pages)

{
  "books": [
    {
      "price": "£51.77",
      "title": "A Light in the Attic"
    },
    {
      "price": "£53.74",
      "title": "Tipping the Velvet"
    },
    {
      "price": "£50.10",
      "title": "Soumission"
    }
  ]
}

General Detail Response Format

General agent returns A flat dictionary with all relevant fields about a single item when scraping individual item pages with comprehensive information (e.g., product details, profile pages, article pages)

{
  "price": "£51.77",
  "title": "A Light in the Attic",
  "image_url": "../../media/cache/fe/72/fe72f0532301ec28892ae79a629a293c.jpg",
  "description": "It's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition...",
  "availability": "In stock (22 available)",
  "product_information": {
    "UPC": "a897fe39b1053632",
    "Product Type": "Books",
    "Price (excl. tax)": "£51.77",
    "Price (incl. tax)": "£51.77",
    "Tax": "£0.00",
    "Availability": "In stock (22 available)",
    "Number of reviews": 0
  }
}

Listing Agent

Listing agent returns an array of page objects, each containing pagination info and extracted data from the page.

{
  "response": [
    {
      "page_num": 0,
      "data": {
        "mode": "direct",
        "pagination": {
          "current_page": 1,
          "total_pages": 50
        },
        "products": [
          {
            "title": "Product Name",
            "price": "£XX.XX",
            "availability": "In stock"
          },
          {
            "title": "Another Product",
            "price": "£YY.YY",
            "availability": "In stock"
          }
        ],
        "product_count": 20,
        "__counts__": {
          "products": 20
        }
      },
      "total_items": 20,
      "next_found": true
    },
    {
      "page_num": 1,
      "data": {
        "mode": "direct",
        "pagination": {
          "current_page": 2,
          "total_pages": 50
        },
        "products": [
          {
            "title": "Product Name Page 2",
            "price": "£ZZ.ZZ",
            "availability": "In stock"
          }
        ],
        "product_count": 20,
        "__counts__": {
          "products": 20
        }
      },
      "total_items": 20,
      "next_found": true
    }
  ],
  "link": "https://books.toscrape.com/"
}

Map Agent

Map agent returns a list of all discovered URLs with a total count.

{
  "count": 581,
  "urls": [
    "https://books.toscrape.com",
    "https://books.toscrape.com/catalogue/10-day-green-smoothie-cleanse-lose-up-to-15-pounds-in-10-days_581/index.html",
    "https://books.toscrape.com/catalogue/1000-places-to-see-before-you-die_1/index.html",
    "https://books.toscrape.com/catalogue/1491-new-revelations-of-the-americas-before-columbus_650/index.html"
  ]
}

Response Status Values

The data.status field indicates the current state of your scraping operation:

StatusDescription
FinishedScraping completed successfully
ProcessingScraping is currently in progress
FailedScraping encountered an error (check data.error for details)

On this page