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

# API vs Scraper Jobs

HasData offers two ways to extract data: **APIs** and **Scraper Jobs**. Both are powered by the same backend, but differ in how they're triggered, what they’re best suited for, and how results are delivered.

```mermaid theme={null}
sequenceDiagram
  autonumber
  participant Client
  participant HasData API
  participant Scraper Engine
  participant Webhook (Client)

  Note over Client,HasData API: API Request Flow
  Client->>HasData API: Send API Request
  HasData API->>Scraper Engine: Scrape Target Page
  Scraper Engine-->>HasData API: Return Extracted Data
  HasData API-->>Client: Return Response (HTML/JSON)

  Note over Client,HasData API: Scraper Job Flow
  Client->>HasData API: Submit Scraper Job
  HasData API-->>Client: Return Job ID + Status: queued
  HasData API->>Scraper Engine: Run Scraper Job (async)
  Scraper Engine-->>HasData API: Processed Result
  HasData API-->>Webhook (Client): Send Result via Webhook
```

## When to Use APIs

Use APIs when you need:

* Fast, real-time responses
* One-off requests with a known URL or query
* Integration into apps, bots, dashboards, or workflows that expect immediate data

APIs are synchronous — you send a request and get the result in the same HTTP response.

<Tip>
  **Example Use Cases**

  * Search Google SERP and get results back immediately
  * Fetch product data from Amazon or a listing from Zillow
  * Grab metadata from a specific page
</Tip>

## When to Use Scraper Jobs

Use Scraper Jobs when you need to:

* Scrape a large number of pages or listings
* Crawl through paginated results
* Extract data from complex platforms (e.g. Google Maps, Zillow)
* Run structured scraping at scale

Scraper Jobs are asynchronous — you submit a job with parameters like URLs, filters, or depth. The job runs in the background, and you can:

* Receive the result via webhook
* Or poll for status and download the result when it’s ready

<Tip>
  **Example Use Cases**

  * Crawl all listings for "restaurants in New York" from Google Maps
  * Scrape paginated product results from Amazon or Redfin
  * Extract 1,000+ real estate listings from Zillow with filters
  * Crawl all pages from a website and extract structured content (e.g. blog posts, articles)
</Tip>

Jobs are designed for bulk extraction, crawling, or anything that can’t be done in a single API call.

## Summary

| Feature          | API              | Scraper Job                        |
| ---------------- | ---------------- | ---------------------------------- |
| **Execution**    | Real-time        | Queued / background                |
| **Response**     | Sync (immediate) | Async (webhook or polling)         |
| **Best for**     | Single queries   | Multi-page or high-volume scraping |
| **Credit Model** | Per request      | Per data row                       |
