# Internet Archive API

> Returns searchable item metadata, collections, recent uploads and file lists from the Internet Archive's digital library.

Category: Search & Knowledge. Region: global. 6 endpoints at `https://api.hoshime.com/v1/internetarchive/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/internetarchive
## GET /v1/internetarchive/search

Search the Internet Archive's items with a query in Lucene syntax, such as title:(pride and prejudice).

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search terms or a field query, such as title:(pride and prejudice). (e.g. title:(pride and prejudice)) |
| `limit` | integer | no | Items per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `creators` (string[]), `date` (string), `identifier` (string), `mediaType` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/internetarchive/search?query=title%3A%28pride+and+prejudice%29" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/internetarchive/item

The metadata of one Internet Archive item: title, creators, date, language, subjects and description.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Item identifier, such as prideandprejudice00aust. (e.g. prideandprejudice00aust) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `creators` (string[]), `date` (string), `description` (string), `fileCount` (integer (int64)), `identifier` (string), `language` (string), `mediaType` (string), `subjects` (string[]), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/internetarchive/item?id=prideandprejudice00aust" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/internetarchive/collections

Collections of the Internet Archive that match a word, such as literature. Without a word it lists collections in general.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Words in the collection title or description, such as literature. (e.g. literature) |
| `limit` | integer | no | Collections per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `creators` (string[]), `date` (string), `identifier` (string), `mediaType` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/internetarchive/collections?query=literature" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/internetarchive/recent

The newest items of one media type that the Internet Archive published, newest first.

Scope: `social:read` · Units: 1 · Cached: 15 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `mediaType` | string | no | Media type: texts, audio, movies, image, software, etree, data, web or collection. (one of texts, audio, movies, image, software, etree, data, web, collection; default texts; e.g. texts) |
| `limit` | integer | no | Items per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `creators` (string[]), `date` (string), `identifier` (string), `mediaType` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/internetarchive/recent?mediaType=texts" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/internetarchive/files

The files of one item with their format and size, such as the scanned text and the PDF.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Item identifier, such as prideandprejudice00aust. (e.g. prideandprejudice00aust) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `items` (File[]), `items[].format` (string), `items[].name` (string), `items[].size` (integer (int64)), `items[].source` (string), `items[].url` (string)

```bash
curl "https://api.hoshime.com/v1/internetarchive/files?id=prideandprejudice00aust" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/internetarchive/closestSnapshot

The Wayback Machine capture of a web page closest to a date: its snapshot URL and capture time. Use it to see how a page looked at a past date.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Web page address, such as https://example.com/. (e.g. https://example.com/) |
| `timestamp` | string | no | Date to search around, as YYYY, YYYYMMDD or YYYYMMDDhhmmss. Omit it for the latest capture. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `capturedAt` (string), `originalUrl` (string), `statusCode` (integer (int64)), `url` (string)

```bash
curl "https://api.hoshime.com/v1/internetarchive/closestSnapshot?url=https%3A%2F%2Fexample.com%2F" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
