YOUTUBE API

Search

Retrieve search from YouTube with a single API request.

GET/api/data/v1/youtube/search
1credit base cost

Request parameters

Up to 1 credit

Search query. For stricter title matching, use YouTube's intitle: operator, for example intitle:"Foursquare Swarm". Quoted queries by themselves may still be broadened by YouTube when no fresh exact matches are available.

Upload date

Sort by

Type of content to search for

Duration of the video. Only applies to videos (not shorts).

2 letter country code of the country to put the proxy in.

Continuation token to get more videos. Get 'continuationToken' from previous response.

This will get you the like + comment count and the description. To get the full details of the video, use the /v1/youtube/video endpoint. *This will slow down the response slightly.*

Try in the console

Live requests use your prepaid balance. Cached responses cost zero where supported.

curl --request GET \
  --url 'https://fetchgoblin.com/api/data/v1/youtube/search' \
  --header 'x-api-key: YOUR_FETCHGOBLIN_API_KEY'

Response

Example
{
  "success": true,
  "videos": [
    {
      "type": "video",
      "id": "BzSzwqb-OEE",
      "url": "https://www.youtube.com/watch?v=BzSzwqb-OEE",
      "title": "NF - RUNNING (Audio)",
      "thumbnail": "https://i.ytimg.com/vi/BzSzwqb-OEE/hq720.jpg?sqp=-oaymwEnCNAFEJQDSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLCasEKav1CLqeSSE2IYDqjGiIMBGw",
      "channel": {
        "id": "UCoRR6OLuIZ2-5VxtnQIaN2w",
        "title": "NFrealmusic",
        "handle": "channel/UCoRR6OLuIZ2-5VxtnQIaN2w",
        "thumbnail": "https://yt3.ggpht.com/J1_Si0TYNZ-991v09y8RpCh4_Z_ALwKmPgMYnJqjNhoglVtipf3oEN8LpzG1kS0qsv8Jptpmmg=s88-c-k-c0x00ffffff-no-rj"
      },
      "viewCountText": "14,860,541 views",
      "viewCountInt": 14860541,
      "publishedTimeText": "2 years ago",
      "publishedTime": "2023-05-28T17:08:46.499Z",
      "lengthText": "4:14",
      "lengthSeconds": 254,
      "badges": []
    }
  ],
  "channels": [],
  "playlists": [],
  "shorts": [
    {
      "type": "short",
      "id": "uMNvF-lSCHg",
      "url": "https://www.youtube.com/watch?v=uMNvF-lSCHg",
      "title": "LONG RUN ROUTINE #run #runvlog #runner #shorts #morning",
      "thumbnail": "https://i.ytimg.com/vi/uMNvF-lSCHg/hq720.jpg?sqp=-oaymwFBCNAFEJQDSFryq4qpAzMIARUAAIhCGADYAQHiAQoIGBACGAY4AUAB8AEB-AG2CIACgA-KAgwIABABGFsgXyhlMA8=&rs=AOn4CLA_P-5ExEn9EGLJDNeJedsxb3k1eQ",
      "channel": {
        "id": "UCGRdcRxpJWi5Q2oDCrMDUuQ",
        "title": "Abby and Ryan",
        "handle": "abbyandryan",
        "thumbnail": "https://yt3.ggpht.com/8UdUEesepx1Ry_rFUPJOJgndTCKno9VTkSysnuJpFjMj63N6av0pNwnqoiKh_7PN2dw7PGIp=s68-c-k-c0x00ffffff-no-rj"
      },
      "viewCountText": "462,705 views",
      "viewCountInt": 462705,
      "publishedTimeText": "10 months ago",
      "publishedTime": "2024-07-28T17:08:46.498Z",
      "lengthText": "0:44",
      "lengthSeconds": 44,
      "badges": []
    }
  ],
  "shelves": [
    {
      "type": "shelf",
      "title": "Shorts",
      "items": [
        {
          "type": "short",
          "id": "LLBR5nO05tE",
          "url": "https://www.youtube.com/watch?v=LLBR5nO05tE",
          "title": "running through walls gone wrong",
          "thumbnail": "https://i.ytimg.com/vi/LLBR5nO05tE/oardefault.jpg?sqp=-oaymwEoCJUDENAFSFqQAgHyq4qpAxcIARUAAIhC2AEB4gEKCBgQAhgGOAFAAQ==&rs=AOn4CLCYYIIDmBllgkLP68AjVs25UpyevQ",
          "viewCountText": "750K",
          "viewCountInt": 750000
        }
      ]
    }
  ],
  "lives": [],
  "continuationToken": "EooDEg...",
  "credits_charged": 1,
  "credits_remaining": 1000,
  "request_id": "00000000-0000-4000-8000-000000000000"
}
Example data from the API specification. Run a request to retrieve current data.

Response shape

This schema describes the documented data shape. Some platform fields may be absent or null. The response also includes your FetchGoblin request ID and current credit balance.

View JSON Schema +
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "videos": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "thumbnail": {
            "type": "string"
          },
          "channel": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "handle": {
                "type": "string"
              },
              "thumbnail": {
                "type": "string"
              }
            }
          },
          "viewCountText": {
            "type": "string"
          },
          "viewCountInt": {
            "type": "integer"
          },
          "publishedTimeText": {
            "type": "string"
          },
          "publishedTime": {
            "type": "string"
          },
          "lengthText": {
            "type": "string"
          },
          "lengthSeconds": {
            "type": "integer"
          },
          "badges": {
            "type": "array"
          }
        }
      }
    },
    "channels": {
      "type": "array"
    },
    "playlists": {
      "type": "array"
    },
    "shorts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "thumbnail": {
            "type": "string"
          },
          "channel": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "handle": {
                "type": "string"
              },
              "thumbnail": {
                "type": "string"
              }
            }
          },
          "viewCountText": {
            "type": "string"
          },
          "viewCountInt": {
            "type": "integer"
          },
          "publishedTimeText": {
            "type": "string"
          },
          "publishedTime": {
            "type": "string"
          },
          "lengthText": {
            "type": "string"
          },
          "lengthSeconds": {
            "type": "integer"
          },
          "badges": {
            "type": "array"
          }
        }
      }
    },
    "shelves": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "thumbnail": {
                  "type": "string"
                },
                "viewCountText": {
                  "type": "string"
                },
                "viewCountInt": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "lives": {
      "type": "array"
    },
    "continuationToken": {
      "type": "string"
    },
    "credits_charged": {
      "type": "integer",
      "minimum": 0,
      "description": "FetchGoblin credits charged for this request."
    },
    "credits_remaining": {
      "type": "integer",
      "description": "Your FetchGoblin credit balance after this request."
    },
    "request_id": {
      "type": "string",
      "format": "uuid",
      "description": "FetchGoblin request identifier."
    }
  }
}