# Wayback Machine nearest-date capture lookup API

Get Wayback Nearest Capture data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, url, and retrieve structured data including available, matched archived URL, formatted capture timestamp, archived HTTP status code, and wayback Machine viewer URL to verify archive existence, resolve fallback links, and locate point-in-time evidence.

Documentation: https://openany.si/wayback-machine/wayback-machine-nearest-date-capture-lookup-api/1deb58ed-c98d-418b-a8e4-60043677707a/
API ID: 1deb58ed-c98d-418b-a8e4-60043677707a
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/wayback/v1/closest
Page update time: 2026-12-03T02:55:14.762Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:39:05.373Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## Wayback Nearest Capture API

Send url and optional timestamp (YYYY, YYYYMM, YYYYMMDD or YYYYMMDDhhmmss) in the GET query string. The lightweight response returns available, timestamp, date, status, snapshot\_url and raw\_url for the nearest matching archive capture.

## What You Can Build

- **Verify archive existence**: Check available and status before queuing heavier full-page extraction calls.
- **Resolve fallback links**: Replace dead outbound links with snapshot\_url closest to the original publication date.
- **Locate point-in-time evidence**: Find the nearest capture to a compliance or audit date using timestamp.

## Returned Data

| Field | Meaning |
| --- | --- |
| `available` | Boolean indicating whether a snapshot was found |
| `url` | Matched archived URL |
| `requested` | Original requested URL or parameters |
| `timestamp` | 14-digit timestamp of the nearest capture |
| `date` | Formatted capture timestamp |
| `status` | Archived HTTP status code |
| `snapshot_url` | Wayback Machine viewer URL |
| `raw_url` | Direct raw archived content URL |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Wayback Machine nearest-date capture lookup API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "A page link or a domain, with or without https://."
        },
        "timestamp": {
          "type": "string",
          "description": "Date: YYYY, YYYYMM, YYYYMMDD or YYYYMMDDhhmmss (dashes allowed)."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON exports are not exposed.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "Native CSV/NDJSON record selector; it has no effect on this JSON-only product."
        }
      },
      "required": [
        "url"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean"
    },
    "cached": {
      "type": "boolean"
    },
    "credits_used": {
      "type": "integer"
    },
    "date": {
      "type": "string"
    },
    "raw_url": {
      "type": "string"
    },
    "requested": {
      "type": "string"
    },
    "snapshot_url": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "timestamp": {
      "type": "string"
    },
    "url": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/wayback/v1/closest?output=json&url=example.com' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "available": true,
  "cached": false,
  "credits_used": 1,
  "date": "2007-01-09T18:48:16Z",
  "raw_url": "https://web.archive.org/web/20070109184816id_/http://www.apple.com/",
  "requested": "2007-01-09",
  "snapshot_url": "https://web.archive.org/web/20070109184816/http://www.apple.com/",
  "status": 200,
  "timestamp": "20070109184816",
  "url": "apple.com"
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### What does available=false mean?
It means no matching Wayback Machine snapshot was found for the requested URL.

### Is the returned timestamp guaranteed to match my requested date?
No. The endpoint returns the nearest available capture; compare timestamp and date against your target.

### What date formats does timestamp accept?
Pass YYYY, YYYYMM, YYYYMMDD or YYYYMMDDhhmmss (dashes are allowed).

### Does this endpoint return the page's HTML or Markdown text?
No. It returns capture availability and URLs; pass the resolved timestamp to the Wayback Historical Page API to read content.

### Can I pass a domain without https://?
Yes. url accepts a page link or domain with or without the https:// scheme.

### How do I check for newly archived captures?
Pass fresh=1 to bypass the 24-hour cache.

## Available implementations
- apish: https://openany.si/wayback-machine/wayback-machine-nearest-date-capture-lookup-api/1deb58ed-c98d-418b-a8e4-60043677707a/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
