# Instagram API

> Returns public account profiles, posts, reels, post comments, captions, media and engagement counts from Instagram.

Category: Social & Video. Region: global. 5 endpoints at `https://api.hoshime.com/v1/instagram/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/instagram
## GET /v1/instagram/profile

Profile, statistics and latest posts of one account.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, with or without @, or profile URL. (e.g. nasa) |
| `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: `avatarUrl` (string), `bio` (string), `createdAt` (string), `externalUrl` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `id` (string), `name` (string), `postCount` (integer (int64)), `private` (boolean), `recentPosts` (Post[]), `recentPosts[].author` (Author), `recentPosts[].commentCount` (integer (int64)), `recentPosts[].createdAt` (string), `recentPosts[].displayUrl` (string), `recentPosts[].id` (string), `recentPosts[].likeCount` (integer (int64)), `recentPosts[].media` (Media[]), `recentPosts[].shareCount` (integer (int64)), `recentPosts[].shortcode` (string), `recentPosts[].text` (string), `recentPosts[].type` (string), `recentPosts[].url` (string), `recentPosts[].viewCount` (integer (int64)), `url` (string), `username` (string), `verified` (boolean)

```bash
curl "https://api.hoshime.com/v1/instagram/profile?username=nasa" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/instagram/post

Caption, author, media and counts of one post or reel.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Shortcode, or post, reel or tv URL. (e.g. DfahZrMjAqq) |
| `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: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `authorPrivate` (boolean), `authorVerified` (boolean), `commentCount` (integer (int64)), `createdAt` (string), `displayUrl` (string), `hashtags` (string[]), `id` (string), `likeCount` (integer (int64)), `location` (string), `media` (Media[]), `media[].durationSeconds` (integer (int64)), `media[].height` (any), `media[].thumbnailUrl` (string), `media[].type` (string), `media[].url` (string), `media[].width` (any), `mentions` (string[]), `productType` (string), `shareCount` (integer (int64)), `shortcode` (string), `text` (string), `type` (string), `url` (string), `viewCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/instagram/post?id=DfahZrMjAqq" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/instagram/postComments

Comments on one post or reel, in the order Instagram shows them to signed-out visitors.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Shortcode, or post, reel or tv URL. (e.g. DfahZrMjAqq) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 25. (default 20) |
| `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: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `createdAt` (string), `id` (string), `likeCount` (integer (int64)), `replyCount` (integer (int64)), `text` (string)

```bash
curl "https://api.hoshime.com/v1/instagram/postComments?id=DfahZrMjAqq" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/instagram/userPosts

Posts of one account, newest first, 12 per page.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, with or without @, or profile URL. (e.g. nasa) |
| `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: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `authorPrivate` (boolean), `authorVerified` (boolean), `commentCount` (integer (int64)), `createdAt` (string), `displayUrl` (string), `hashtags` (string[]), `id` (string), `likeCount` (integer (int64)), `location` (string), `media` (Media[]), `media[].durationSeconds` (integer (int64)), `media[].height` (any), `media[].thumbnailUrl` (string), `media[].type` (string), `media[].url` (string), `media[].width` (any), `mentions` (string[]), `productType` (string), `shareCount` (integer (int64)), `shortcode` (string), `text` (string), `type` (string), `url` (string), `viewCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/instagram/userPosts?username=nasa" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/instagram/reels

Reels of one account, newest first. A page holds the reels among its 12 latest posts.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, with or without @, or profile URL. (e.g. nasa) |
| `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: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `authorPrivate` (boolean), `authorVerified` (boolean), `commentCount` (integer (int64)), `createdAt` (string), `displayUrl` (string), `hashtags` (string[]), `id` (string), `likeCount` (integer (int64)), `location` (string), `media` (Media[]), `media[].durationSeconds` (integer (int64)), `media[].height` (any), `media[].thumbnailUrl` (string), `media[].type` (string), `media[].url` (string), `media[].width` (any), `mentions` (string[]), `productType` (string), `shareCount` (integer (int64)), `shortcode` (string), `text` (string), `type` (string), `url` (string), `viewCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/instagram/reels?username=nasa" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
