Skip to Content

Search Suggestions

What the search box suggests for a few letters.

GET
/v1/youtube/search/suggestions

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from the dashboard: Authorization: Bearer sapi_….

Query Parameters

query*string

The first letters of a search.

maxAge?integer

How old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.

Formatint64
Range0 <= value

Response Body

The answer.

application/json
  1. response

A page of a list, as every list endpoint answers: { "data": [...], "pagination": … }.

data*array<>
pagination*
Example Request
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data, pagination } = await client.youtube.searchSuggestions({ query: "coffee" });
Example Response
{  "data": [    {      "text": "coffeezilla"    },    {      "text": "coffee"    }  ],  "pagination": {    "nextCursor": null,    "hasMore": false  }}