{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Wayback API", "description": "API for Internet Archive's Wayback Machine" }, "host": "api.archive.org", "schemes": [ "https" ], "basePath": "/", "produces": [ "application/json", "application/javascript" ], "paths": { "/wayback/v1/available": { "get": { "responses": { "200": { "$ref": "#/responses/AvailabilityResults" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } }, "parameters": [ { "$ref": "#/parameters/url" }, { "$ref": "#/parameters/timestamp" }, { "$ref": "#/parameters/callback" }, { "$ref": "#/parameters/timeout" }, { "$ref": "#/parameters/closest" }, { "$ref": "#/parameters/status_code" }, { "$ref": "#/parameters/tag" } ] }, "post": { "consumes": [ "application/json", "text/csv", "application/x-www-form-urlencoded" ], "responses": { "200": { "$ref": "#/responses/AvailabilityResults" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } }, "parameters": [ { "$ref": "#/parameters/url" }, { "$ref": "#/parameters/timestamp" }, { "$ref": "#/parameters/callback" }, { "$ref": "#/parameters/timeout" }, { "$ref": "#/parameters/closest" }, { "$ref": "#/parameters/status_code" }, { "$ref": "#/parameters/tag" }, { "name": "availabilty_request", "in": "body", "schema": { "$ref": "#/definitions/AvailabilityRequests" } } ] } } }, "parameters": { "url": { "name": "url", "in": "query", "type": "string", "description": "A single URL to query.", "required": true }, "closest": { "name": "closest", "in": "query", "description": "The direction specifies whether to match archived timestamps that are before the provided one, after, or the default either (closest in either direction). Must be before, after, or either. May be overidden by individual requests.\n", "default": "either", "type": "string", "enum": [ "either", "before", "after" ], "required": false }, "timestamp": { "name": "timestamp", "description": "Timestamp requested in ISO 8601 format. The following formats are acceptable:\n - YYYY\n - YYYY-MM\n - YYYY-MM-DD\n - YYYY-MM-DDTHH:mm:SSz\n - YYYY-MM-DD:HH:mm+00:00\n", "in": "query", "type": "string", "required": false }, "callback": { "name": "callback", "description": "Specifies a JavaScript function func, for a JSON-P response. When provided, results are wrapped as `callback(data)`, and the returned MIME type is application/javascript. This causes the caller to automatically run the func with the JSON results as its argument.\n", "in": "query", "type": "string", "required": false }, "timeout": { "name": "timeout", "description": "Timeout is the maximum number of seconds to wait for the availability API to get its underlying results from the CDX server. The default value is 5.0.\n", "in": "query", "type": "number", "required": false, "default": 5 }, "status_code": { "name": "status_code", "description": "HTTP status codes to filter by. Only results with these codes will be returned\n", "in": "query", "type": "integer", "enum": [ 200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 426, 428, 429, 431, 500, 501, 502, 503, 504, 505, 506, 507, 511 ], "collectionFormat": "multi", "required": false }, "tag": { "name": "tag", "description": "The optional tag can have any value, and is returned with the results; it can be used to help collate input and output values.\n", "in": "query", "type": "string", "required": false } }, "definitions": { "Snapshot": { "type": "object", "properties": { "url": { "type": "string", "description": "The URL requested" }, "timestamp": { "type": "string", "format": "dateTime", "description": "The timestamp of the snapshot in [RFC 3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html) format" }, "status": { "type": "integer", "description": "The HTTP status of the URL requested" } } }, "AvailabilityResults": { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/definitions/ArchivedResult" }, "description": "A list of results" } }, "required": [ "results" ] }, "ArchivedResult": { "type": "object", "properties": { "url": { "type": "string", "description": "The URL requested" }, "timestamp": { "type": "string", "format": "dateTime", "description": "The _intepreted_ timestamp requested, in [RFC 3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html) format" }, "tag": { "type": "string", "description": "The user-supplied tag for use in collation" }, "snapshot": { "$ref": "#/definitions/Snapshot" } }, "required": [ "url", "timestamp", "snapshot" ] }, "AvailabilityRequests": { "type": "array", "items": { "$ref": "#/definitions/AvailabilityRequest" }, "example": [ { "url": "http://www.entish.org", "timestamp": "2016-04-07T19:39:18Z", "tag": "0" }, { "url": "http://www.cnn.com/", "tag": "1" }, { "url": "http://www.youcantfindthis.cat", "timestamp": "2016-04-07T19:39:18Z", "tag": "2" } ] }, "AvailabilityRequest": { "type": "object", "properties": { "url": { "type": "string", "description": "The URL requested" }, "timestamp": { "type": "string", "description": "Timestamp requested in ISO 8601 format. The following formats are acceptable: - YYYY - YYYY-MM - YYYY-MM-DD - YYYY-MM-DDTHH:mm:SSz - YYYY-MM-DD:HH:mm+00:00\n" }, "tag": { "type": "string", "description": "A user-supplied tag, used for collation" }, "closest": { "type": "string", "description": "The direction to find the closest snapshot to the requested timestamp", "enum": [ "either", "after", "before" ] } }, "required": [ "url" ] }, "Error": { "type": "object", "properties": { "code": { "type": "integer", "format": "integer" }, "message": { "type": "string" } } } }, "responses": { "AvailabilityResults": { "description": "Nominal Availability results", "schema": { "$ref": "#/definitions/AvailabilityResults" }, "examples": { "applcation/json": { "results": [ { "url": "http://www.entish.org", "timestamp": "2016-04-07T19:39:18Z", "snapshot": { "status": "200", "url": "http://web.archive.org/web/20160111075133/http://entish.org/", "timestamp": "2016-04-07T19:39:18Z" }, "tag": "0" }, { "url": "http://www.cnn.com/", "snapshot": { "url": "http://web.archive.org/web/20160413132039/http://www.cnn.com/", "timestamp": "2016-04-13T13:20:39Z" }, "tag": "1" }, { "url": "http://www.youcantfindthis.cat", "timestamp": "2016-04-07T19:39:18Z", "snapshot": {}, "tag": "2" } ] } } } } }