```yaml
product: AlterLab
title: "Idempotency — Web Scraping Glossary | AlterLab"
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/glossary/idempotency
```

infrastructure

# Idempotency

Idempotency means that making the same API request multiple times produces the same result as making it once, enabling safe retries without duplicate side effects.

An operation is idempotent if repeating it has the same observable effect as performing it once. HTTP GET and DELETE are idempotent by definition; HTTP POST (which creates a new resource each time) is not. Idempotency keys — unique identifiers sent with requests — allow servers to detect duplicate requests and return the cached result of the first execution instead of repeating the operation.

In scraping APIs, idempotency is important for reliable job submission under retries. If a client submits a scrape job and the network fails before the response arrives, the client cannot know whether the server received the request. An idempotency key lets the client safely retry: the server checks if a job with that key already exists and returns its status rather than creating a duplicate job.

Idempotency also applies to data writes in scraping pipelines: inserting a scraped record should use upsert semantics (insert if absent, ignore or update if present) to prevent duplicate rows when the same URL is scraped more than once.

### What is Idempotency?

Idempotency means that making the same API request multiple times produces the same result as making it once, enabling safe retries without duplicate side effects.

### How does AlterLab handle Idempotency?

Idempotency also applies to data writes in scraping pipelines: inserting a scraped record should use upsert semantics (insert if absent, ignore or update if present) to prevent duplicate rows when the same URL is scraped more than once.

## Examples

```
# Pass an idempotency key with a scrape job submission
import httpx, uuid

key = str(uuid.uuid4())
response = httpx.post(
    "https://api.alterlab.io/v1/scrape",
    headers={"X-Idempotency-Key": key},
    json={"url": "https://example.com"}
)
# Safe to retry with the same key if this call fails
```

## Related Terms

[Retry LogicAutomated re-sending of failed requests with backoff strategies, essential for handling transient errors, rate limits, and flaky anti-bot challenges.](https://alterlab.io/glossary/retry-logic)[WebhookAn HTTP callback that delivers data to a specified URL when an async scrape job completes.](https://alterlab.io/glossary/webhook)[Job QueueA job queue is a buffer that decouples producers (tasks submitted by clients) from consumers (workers that execute the tasks), enabling asynchronous, scalable processing.](https://alterlab.io/glossary/queue)[Scraping APIA managed web scraping service that abstracts proxy rotation, JavaScript rendering, and automatic website compatibility into a single HTTP endpoint.](https://alterlab.io/glossary/scraping-api)[REST APIA web service that exposes data and actions through standard HTTP methods and resource-oriented URLs, returning structured JSON responses.](https://alterlab.io/glossary/rest-api)

## Extract Idempotency data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

[View API docs](https://alterlab.io/docs/api/rest)

[Back to Glossary](https://alterlab.io/glossary)