---
title: "Posts"
description: "X 계정의 최근 게시물을 나열합니다."
---

```http
GET | POST /v1/x/posts
```

파라미터는 `GET`의 쿼리 문자열로도, `POST`의 JSON 본문으로도 보낼 수 있습니다. 둘은 같습니다.

## 넘길 값

| 넘기는 값 | 읽는 것 | 비고 |
|---|---|---|
| `username` 또는 `userId` | 계정의 최근 게시물 | `userId`는 조회 한 번을 절약 |

호출마다 소스는 하나만 넘기세요. 모든 식별자는 페이지 URL도 받습니다.

## 받게 되는 목록

로그인하지 않은 X는 계정마다 두 목록 중 하나를 보여 주며, 어느 쪽인지는 페이지의 `ext.order`에 적힙니다.

- `latest`: 계정의 게시물을 최신순으로, 페이지당 약 20개씩, 다음 페이지용 `cursor`와 함께 돌려줍니다.
- `popular`: 일부 계정에는 X가 대신 좋아요가 가장 많은 게시물 약 100개를 한 페이지로 보여 줍니다. 날짜순이 아니며 `cursor`가 없습니다.

계정이 고정한 게시물은 첫 페이지 맨 앞에 `pinned: true`로 표시되어 한 번만 나오고, 다음 페이지에서는 반복되지 않습니다. 페이지 크기는 X가 정하므로 `limit`은 참고값일 뿐입니다.

## 파라미터

| Parameter | Type | Required | Notes |
|---|---|---|---|
| `cursor` | string |  | Opaque cursor from the previous page's `cursor`. Pass it alone for the next page. |
| `limit` | integer 1–100 |  | Items per page, 1–100 — a hint only: X decides the page size (about 20, or ~100 for the most-liked list). |
| `userId` | string |  | Numeric user id. Pass it instead of a username to save the lookup. |
| `username` | string |  | @handle (with or without @), or the profile URL. |

## 요청

```bash tab="cURL"
curl "https://gateway.apinoa.com/v1/x/posts?username=nasa&limit=5" \
  -H "x-api-key: $APINOA_API_KEY"
```

```js tab="JavaScript"
const params = new URLSearchParams({ username: "nasa", limit: "5" });
const res = await fetch(`https://gateway.apinoa.com/v1/x/posts?${params}`, {
  headers: { "x-api-key": process.env.APINOA_API_KEY },
});
const { success, data, error } = await res.json();
```

```python tab="Python"
import os

import requests

res = requests.get(
    "https://gateway.apinoa.com/v1/x/posts",
    params={"username": "nasa", "limit": "5"},
    headers={"x-api-key": os.environ["APINOA_API_KEY"]},
)
body = res.json()
```

## 응답

`data`에 [`Post`](/docs/api-reference/sns/response-schema#post) [`Page`](/docs/api-reference/sns/response-schema#page)를 돌려줍니다. 실제 응답을 줄인 것입니다. 배열은 앞쪽 항목만 남기고 긴 텍스트는 잘랐습니다.

```json
{
  "success": true,
  "data": {
    "platform": "x",
    "items": [
      {
        "platform": "x",
        "id": "2113776971603689874",
        "url": "https://x.com/NASA/status/2113776971603689874",
        "author": {
          "platform": "x",
          "id": "11348282",
          "handle": "NASA",
          "displayName": "NASA",
          "url": "https://x.com/NASA",
          "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB.jpg",
          "verified": true,
          "counts": {
            "followers": 92311241,
            "following": 115,
            "posts": 74453
          },
          "ext": {
            "blueVerified": true,
            "verifiedType": "Government"
          }
        },
        "text": "We are not slowing down. 🚀\n\nOur Artemis III mission will send four astronauts to low Earth orbit next year to test crit…",
        "createdAt": "2026-10-23T23:37:56.000Z",
        "lang": "en",
        "media": [
          {
            "type": "video",
            "url": "https://video.twimg.com/amplify_video/2113776813121941504/vid/avc1/1920x1080/oa29OYgVBG7qAyEB.mp4?tag=16",
            "thumbnailUrl": "https://pbs.twimg.com/media/HVWk812WIAAg_hz.jpg?name=orig",
            "width": 3840,
            "height": 2160,
            "durationSec": 59.893,
            "variants": [
              {
                "url": "https://video.twimg.com/amplify_video/2113776813121941504/pl/Sws2JLpHl8xdzMyH.m3u8?tag=16&v=ab6",
                "contentType": "application/x-mpegURL"
              },
              {
                "url": "https://video.twimg.com/amplify_video/2113776813121941504/vid/avc1/480x270/CK1pQpicyNC7ryVp.mp4?tag=16",
                "bitrate": 288000,
                "contentType": "video/mp4"
              }
            ]
          }
        ],
        "metrics": {
          "likes": 5396,
          "comments": 236,
          "views": 900353,
          "reposts": 680,
          "quotes": 59,
          "saves": 259
        },
        "entities": {
          "urls": [
            {
              "url": "https://go.nasa.gov/4jzartX",
              "displayUrl": "go.nasa.gov/4jzartX"
            },
            {
              "url": "https://go.nasa.gov/4zV3TLc",
              "displayUrl": "go.nasa.gov/4zV3TLc"
            }
          ]
        },
        "ext": {
          "conversationId": "2113776971603689874"
        },
        "pinned": true
      }
    ],
    "cursor": "LssW7FrvIb2W_z-EPjiVogYoj3-70ruy8A1hYTEVJNyV1xfWjamuub5cCUPOolr5oPAzKDidQINisvCy-drXkJvvPVGst8_JWWGhxGuKr_D5Ykq9D8H5vhr…",
    "ext": {
      "order": "latest"
    }
  }
}
```

## 에러

| 상태 | 코드 | 의미 |
|---|---|---|
| 400 | `INVALID_CURSOR` | 이 오퍼레이션이 돌려준 `cursor`가 아닙니다. `cursor` 없이 처음부터 다시 호출하세요. |
| 400 | `INVALID_PARAMS` | 파라미터가 없거나, 알 수 없거나, 범위를 벗어났습니다. 메시지에 이름이 나옵니다. |
| 401 | `UNAUTHORIZED` | `x-api-key` 헤더가 없거나, 폐기되었거나 알 수 없는 키입니다. |
| 402 | `INSUFFICIENT_BALANCE` | 잔액이 이 호출 비용에 모자랍니다. 대시보드에서 충전하세요. |
| 404 | `NOT_FOUND` | 계정·게시물·그룹이 없거나, 비공개·삭제·연령 제한 상태입니다. |
| 429 | `MARKETPLACE_SATURATED` | 동시 호출이 너무 많습니다. `Retry-After` 초만큼 기다린 뒤 다시 시도하세요. |
| 502 | `UPSTREAM_ERROR` | 플랫폼이 쓸 수 없는 응답을 보냈습니다. 간격을 두고 다시 시도하세요. |

모든 코드는 [Errors](/docs/errors)에 있습니다. 실패한 호출은 과금되지 않습니다.

## 가격

**Price** $0.001 per call, plus $0.001 for each extra call it makes — at most 1 more, so $0.002 in total. [List price](https://apinoa.com/en/pricing); the rate steps down above 1,000 calls a day.
