Call it
curl https://api.peume.com/v1/call/search-youtube-2 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"search_query": "your search query"
}
}'const res = await fetch("https://api.peume.com/v1/call/search-youtube-2", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"search_query": "your search query"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/search-youtube-2",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"search_query": "your search query"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: search-youtube-2.
Parameters
hlstringThe language to use for the Youtube search. It's a two or three-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French), optionally followed by a two-letter or three-digit region code (e.g., `en-gb` for British English, or `es-419` for Latin American Spanish).
glstringThe country to use for the Google search. It's a two-letter country code. (e.g., `us` for the United States, `uk` for United Kingdom, or `fr` for France)
search_queryRequiredstringThe search query. You can use anything that you would use in a regular YouTube search.
spstringCan be used for pagination. YouTube uses continuous pagination and the next page token can be found in the JSON response `pagination -> next_page_token` and `pagination -> next_page_token` fields. Parameter can also be used to filter the search results: by Upload date, you need to set the `sp` parameter to `CAI%3D` by 4K, you need to set the `sp` parameter to `EgJwAQ%3D%3D`... It can also be used for forcing the exact search query spelling by setting the `sp` value to `QgIIAQ%3D%3D`. If you are interested in passing other filters, you can visit the YouTube website, set filters you wan
json_restrictorstringThe fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
