> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Instagram API

> 公開されている Instagram のプロフィール、いいね数とコメント数付きの最近の投稿、単一の投稿とリール、コメント、キーワード検索を JSON で読み取ります。

公開されている Instagram のデータを非同期タスク API で JSON として読み取ります。`taskType` `SOCIAL` に `platform` `instagram` を指定し、`action` で読み取る対象を選びます。完了したリクエスト 1 件につき **0.5 クレジット**です。

## リクエスト

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "SOCIAL", "payload": { "platform": "instagram", "action": "profile", "username": "natgeo" } }'
```

タスクを送信したあと、`GET /v1/async/task/{id}` をポーリングするか Webhook で受け取ります。[非同期タスク](https://docs.querying.ai/ja/concepts/async-tasks.md)を参照してください。

## アクション

| `action` | 読み取る内容 | 必須 |
| - | - | - |
| `search` (デフォルト) | キーワードの投稿とリール | `query` |
| `profile` | 公開アカウントのプロフィールと最近の投稿 12 件 | `username` |
| `posts` | アカウントの最近の投稿 12 件と各投稿の数値 | `username` |
| `post` | 1 件の投稿かリールと最初のコメント | `postUrl` |
| `comments` | 投稿のコメント | `postUrl` |

`username` にはユーザー名かプロフィール URL を指定します。`postUrl` には `https://www.instagram.com/p/Df147tCiAyB/` のような投稿、リール、IGTV の URL を指定します。

## パラメータ

* `query`: `search` では必須。キーワード、ハッシュタグの語、ブランド名です。
* `limit`: 任意。`search` は 1-30 でデフォルトは 10、`posts` は 1-12 でデフォルトは 12、`comments` は 1-500 でデフォルトは 50 です。

## レスポンス例

```json theme={"theme":"css-variables"}
{
  "platform": "instagram",
  "action": "profile",
  "id": "787132",
  "username": "natgeo",
  "displayName": "National Geographic",
  "biography": "Step into wonder and find your inner explorer with National Geographic.",
  "profileUrl": "https://www.instagram.com/natgeo/",
  "isVerified": true,
  "isPrivate": false,
  "followerCount": 268096466,
  "followingCount": 195,
  "postCount": 32000,
  "hasReels": true,
  "threadsUsername": "natgeo",
  "latestStoryAt": "2026-11-17T15:07:32.000Z",
  "recentPosts": [
    {
      "id": "4032379434794749057",
      "code": "Df147tCiAyB",
      "url": "https://www.instagram.com/p/Df147tCiAyB/",
      "mediaType": "carousel",
      "caption": "National Geographic photographers ventured to places far and wide this year.",
      "imageUrl": "https://scontent.cdninstagram.com/v/t51.82787-15/912032737.jpg"
    }
  ]
}
```

## 結果フィールド

* すべてのレスポンスは `platform` と `action` をそのまま返します。一覧には `returnedCount` があります。
* `profile` は `id`、`username`、`displayName`、`biography`、`bioLinks`、`avatarUrl`、`profileUrl`、`isVerified`、`isPrivate`、`followerCount`、`followingCount`、`postCount`、`hasReels`、`highlights`、`threadsUsername`、`pronouns`、`recentPosts` を返します。アカウントがストーリーを公開している間は `latestStoryAt` が現れ、`isMemorialized` は追悼アカウントを示します。
* `posts` は `posts` を返します。アカウントの最近の投稿 12 件で、各投稿のページから読み取った `likeCount`、`commentCount`、`publishedAt` が付きます。
* `post` は `post` と投稿の最初の `comments` を返します。投稿には `id`、`code`、`url`、`mediaType` (`image`、`video`、`carousel`)、`caption`、`imageUrl`、`images`、`videoUrl`、`width`、`height`、`likeCount`、`commentCount`、`publishedAt`、`username`、`authorFullName`、`authorIsVerified`、`authorProfileImageUrl`、`coauthors`、`taggedUsers`、`topics`、`audio` (楽曲か投稿者のオリジナル音源)、`hasAudio`、`captionIsEdited`、`aiLabel`、`commentsDisabled` があります。
* `comments` は `comments` を返します。各コメントには `id`、`text`、`username`、`likeCount`、`replyCount`、`publishedAt` があります。GIF のコメントには `gifUrl` が付きます。`availableCount` は投稿のコメント数で、`partial: true` は一覧がその数より短いことを示します。
* `search` は `posts` を返し、各投稿には `position`、投稿者の `username`、`authorId`、`authorIsVerified`、`authorProfileImageUrl` があり、リールには `playCount` があります。Instagram にそのキーワードの検索ページがある場合、`source` は `instagram` になり、そのページの `title`、`relatedKeywords`、キーワードについての Instagram の `summary` と、その脚注番号が指す `sources` が加わります。ほかのキーワードでは `source` は `web` で、`posts` には直近 30 日の公開投稿とリールが入ります。
* Instagram はログアウトした訪問者に、プロフィールの最近の投稿 12 件と投稿のコメント 10 件ほどを表示し、`posts`、`post`、`comments` はその範囲を返します。検索結果の数値と公開日時は `post` で読み取ります。
* 存在しないアカウントや投稿、非公開の投稿、Instagram がログインした訪問者にしか表示しないページは、タスクを `PAGE_UNAVAILABLE` で終了させます。課金されるのは完了したリクエストだけです。

## 関連

* [YouTube](https://docs.querying.ai/ja/engines/youtube.md)
* [Threads](https://docs.querying.ai/ja/engines/threads.md)
* [エンジン一覧](https://docs.querying.ai/ja/engines/overview.md)
* [クレジットと上限](https://docs.querying.ai/ja/concepts/credits-and-limits.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.