> ## 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.

# Zero Data Retention (ZDR)

> Send a request with zdr and HasData does not store your parameters, the fetched page, or the results.

Zero Data Retention (ZDR) lets you run a request that leaves none of your data behind. Add `zdr` to any API request and HasData returns the response as usual, but does not store the parameters you sent, the page it fetched, or the results it extracted.

<Info>
  ZDR is available on **Enterprise** plans. On other plans a request with `zdr` is rejected. To enable it for your account, contact us at [info@hasdata.com](mailto:info@hasdata.com).
</Info>

## Enable ZDR

ZDR is off by default and is set per request. Add `zdr=true` to the query string of a GET request, or `"zdr": true` to the JSON body of a POST request. It works with every real-time API, including the Web Scraping API, Google SERP API, and all Scraper APIs. Requests without `zdr` behave as they always have.

<CodeGroup>
  ```bash Google SERP API theme={null}
  curl --request GET -G \
    --url 'https://api.hasdata.com/scrape/google/serp' \
    --data-urlencode 'q=Coffee' \
    --data-urlencode 'zdr=true' \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: <your-api-key>'
  ```

  ```bash Web Scraping API theme={null}
  curl --request POST \
    --url 'https://api.hasdata.com/scrape/web' \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: <your-api-key>' \
    --data '{"url":"https://example.com","outputFormat":["markdown"],"zdr":true}'
  ```
</CodeGroup>

A ZDR request costs the same number of credits as the same request without it.

## What HasData Does Not Keep

For a ZDR request, HasData does not store:

* **Your request parameters**, such as the query, the target URL, headers, cookies, and JS scenarios.
* **The fetched page**: no raw HTML is saved.
* **The results**: no copy of the response is saved.
* **Your values in logs**: the values you sent are removed from our logs.

Because no copy is saved, the `requestMetadata` object in a ZDR response has no `html` or `json` links:

```json theme={null}
{
  "requestMetadata": {
    "id": "59208867-8c59-46d7-a883-5c2700b0e0df",
    "status": "ok",
    "url": "https://www.google.com/search?q=Coffee&hl=en&gl=us"
  },
  "searchInformation": { ... },
  "organicResults": [ ... ]
}
```

Save anything you need from the response on your side. HasData cannot resend it or open it later for debugging.

## What HasData Still Keeps

To bill and operate the service, HasData keeps:

* **Request metadata**: the request ID, the API called, the response status, the credits charged, your API key, and the IP address the request came from.
* **The target hostname**, such as `www.google.com`, in our logs. Paths and query strings are never kept.
* **Google image thumbnails**: some Google results (for example, inline images and AI Overviews) link to thumbnails hosted on `files.hasdata.com`. These files are still stored, because the response points to them.

## Features That Do Not Work with ZDR

These Web Scraping API options cannot be combined with ZDR. A request that combines them with `zdr` is rejected with a `422` status before any credits are charged:

* `screenshot`
* `aiExtractRules`

These endpoints keep your inputs and results, so they refuse `zdr` too:

* [Batch Scrape](/apis/web-scraping-api/batch-scrape), including a `zdr` set on any request inside the batch.
* [Scraper Jobs](/basics/api-vs-scraper-jobs), including the [Websites Crawler](/scrapers/websites-crawler/quickstart) and job `enrichments`.
* No-code scrapers.

## Errors

When a ZDR request cannot be served, the API returns `422` and lists the reason in `errors`. You are not charged.

```json theme={null}
{
  "errors": [
    {
      "rule": "zdr",
      "field": "screenshot",
      "message": "screenshot is not available with zero data retention."
    }
  ]
}
```

| `field` | `message` | Fix |
| - | - | - |
| `zdr` | Zero data retention is not available on your plan. | ZDR needs an Enterprise plan. Contact [info@hasdata.com](mailto:info@hasdata.com). |
| `zdr` | Zero data retention is not available on this endpoint. | Send single API requests instead of a batch, scraper job, or no-code scraper. |
| `screenshot`, `aiExtractRules` | `<field>` is not available with zero data retention. | Remove that option, or send the request without `zdr`. |


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