---
title: "Posts"
description: "List YouTube videos: a channel's uploads, a search, a hashtag, related videos, or the trending charts."
---

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

Send parameters as a query string with `GET`, or as a JSON body with `POST`. Both are equivalent.

## What to Pass

| Pass | Reads | Notes |
|---|---|---|
| `username` or `userId` | A channel's uploads | `type`: `videos` (default), `shorts`, `live`, `community` |
| `query` | A video search | `type`: `videos` (default) or `shorts` |
| `hashtag` | Videos under a hashtag |  |
| `relatedTo` | The videos YouTube recommends beside one |  |
| nothing | The trending charts | `country` (default US); 2 units |

Pass one source per call. Every identifier also takes the page URL.

## Parameters

| Parameter | Type | Required | Notes |
|---|---|---|---|
| `country` | string |  | Default feed only: the country whose trending feed to read (ISO alpha-2, default US). |
| `cursor` | string |  | Opaque cursor from the previous page's `cursor`. Pass it alone for the next page. |
| `hashtag` | string |  | Videos under a hashtag, with or without #. |
| `query` | string |  | Search videos by keyword. |
| `relatedTo` | string |  | A video id or URL; returns the videos YouTube recommends beside it. |
| `type` | enum |  | username/userId: which channel tab — videos (default), shorts, live or community · query: videos (default) or shorts. `videos` `shorts` `live` `community` |
| `userId` | string |  | Channel id (UC…). |
| `username` | string |  | Channel @handle (with or without @), or the channel URL (/@handle, /channel/UC…, /c/…, /user/…). |

## Request

```bash tab="cURL"
curl "https://gateway.apinoa.com/v1/youtube/posts?username=%40mkbhd&type=shorts" \
  -H "x-api-key: $APINOA_API_KEY"
```

```js tab="JavaScript"
const params = new URLSearchParams({ username: "@mkbhd", type: "shorts" });
const res = await fetch(`https://gateway.apinoa.com/v1/youtube/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/youtube/posts",
    params={"username": "@mkbhd", "type": "shorts"},
    headers={"x-api-key": os.environ["APINOA_API_KEY"]},
)
body = res.json()
```

## Response

Returns [`Page`](/docs/api-reference/sns/response-schema#page) of [`Post`](/docs/api-reference/sns/response-schema#post) in `data`. A real response, shortened: arrays keep their first entries and long text is cut.

```json
{
  "success": true,
  "data": {
    "platform": "youtube",
    "items": [
      {
        "platform": "youtube",
        "id": "_4ELeWAgMwo",
        "url": "https://www.youtube.com/watch?v=_4ELeWAgMwo",
        "author": {
          "platform": "youtube",
          "id": "UCBJycsmduvYEL83R_U4JriQ",
          "handle": "mkbhd",
          "displayName": "Marques Brownlee",
          "url": "https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ",
          "avatarUrl": "https://yt3.googleusercontent.com/qu4TmIaYUlS41-dJ9gZ7DUR3nilvmB5_11i6OKSdvNnBNiyOusZP1bMN6ICnuxtjFBb6ioKgRQ=s900-c-k-c…"
        },
        "title": "ASMR iPhone Duo Unboxing",
        "media": [
          {
            "type": "video",
            "url": "https://www.youtube.com/watch?v=_4ELeWAgMwo",
            "thumbnailUrl": "https://i.ytimg.com/vi/_4ELeWAgMwo/oar3.jpg?sqp=-oaymwEdCJUDENAFSFWQAgHyq4qpAwwIARUAAIhCcAHAAQY=&rs=AOn4CLDEzqDprq0dEj0…"
          }
        ],
        "metrics": {
          "views": 2100000
        },
        "ext": {
          "isShort": true
        }
      }
    ],
    "cursor": "4PUpJI-hNYFf8QYTuifBDYgNyLZERTjzoZKnbWwvxtxd6TFzjKx55Gw3YS9-IN4MUE1IAmpHzO19I7UGyZlIYr_d0r7eOHkiDMA6R0H8z6gujuSriodxpkF…"
  }
}
```

## Errors

| Status | Code | Meaning |
|---|---|---|
| 400 | `INVALID_CURSOR` | The `cursor` is not one this operation returned. Start again without it. |
| 400 | `INVALID_PARAMS` | A parameter is missing, unknown or out of range. The message names it. |
| 401 | `UNAUTHORIZED` | The `x-api-key` header is missing, or the key is revoked or unknown. |
| 402 | `INSUFFICIENT_BALANCE` | The balance does not cover this call. Top up in the dashboard. |
| 404 | `NOT_FOUND` | The account, post or group does not exist, or is private, deleted or age-restricted. |
| 429 | `MARKETPLACE_SATURATED` | Too many concurrent calls. Retry after the `Retry-After` seconds. |
| 502 | `UPSTREAM_ERROR` | The platform answered with something unusable. Retry with backoff. |

Every code is listed in [Errors](/docs/errors). Failed calls are not billed.

## Pricing

**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.
