> ## 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 데이터를 비동기 task API로 JSON으로 읽습니다. `taskType` `SOCIAL`에 `platform` `instagram`을 보내고 `action`으로 읽을 대상을 고릅니다. 완료된 요청당 **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" } }'
```

task를 제출한 뒤 `GET /v1/async/task/{id}`를 폴링하거나 웹훅으로 받습니다. 참고: [비동기 task](https://docs.querying.ai/ko/concepts/async-tasks.md).

## 동작

| `action` | 읽는 대상 | 필수 |
| - | - | - |
| `search` (기본값) | 키워드의 게시물과 릴스 | `query` |
| `profile` | 공개 계정의 프로필과 최근 게시물 12개 | `username` |
| `posts` | 계정의 최근 게시물 12개와 각 게시물의 수치 | `username` |
| `post` | 게시물이나 릴스 하나와 첫 댓글들 | `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이 로그인한 방문자에게만 보여 주는 페이지는 task를 `PAGE_UNAVAILABLE`로 끝냅니다. 완료된 요청만 과금합니다.

## 관련 문서

* [YouTube](https://docs.querying.ai/ko/engines/youtube.md)
* [Threads](https://docs.querying.ai/ko/engines/threads.md)
* [엔진 목록](https://docs.querying.ai/ko/engines/overview.md)
* [크레딧과 한도](https://docs.querying.ai/ko/concepts/credits-and-limits.md)


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