With , you can extract and parse various types of YouTube data. Below is an overview of all supported YouTube source values.
youtube_search
Up to 20 for a search term of your choice.
youtube_videos
Information about whether a YouTube video
Request sample
curl -X GET "https://serpapi.abcproxy.com/search" \
-d "engine=youtube_search" \
-d "q=coffee" \
-d "no_cache=false" \
-d "api_key=YOUR_API_KEY"
import requests
params = {
"engine": "youtube_search",
"q": "coffee",
"no_cache": "false",
"api_key": "YOUR_API_KEY"
}
response = requests.get("https://serpapi.abcproxy.com/search", params=params)
print(response.json())
const axios = require('axios');
const params = {
engine: "youtube_search",
q: "coffee",
no_cache: "false",
api_key: "YOUR_API_KEY"
};
axios.get("https://serpapi.abcproxy.com/search", { params })
.then(response => console.log(response.data));
GET /search?engine=youtube_search&q=coffee&no_cache=false&api_key=YOUR_API_KEY HTTP/1.1
Host: serpapi.abcproxy.com
youtube_search<?php
$client = new \GuzzleHttp\Client();
$response = $client->get('https://serpapi.abcproxy.com/search', [
'query' => [
'engine' => 'youtube_search',
'q' => 'coffee',
'no_cache' => 'false',
'api_key' => 'YOUR_API_KEY'
]
]);
echo $response->getBody();
package main
import (
"net/http"
"io/ioutil"
"log"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://serpapi.abcproxy.com/search", nil)
q := req.URL.Query()
q.Add("engine", "youtube_search")
q.Add("q", "coffee")
q.Add("no_cache", "false")
q.Add("api_key", "YOUR_API_KEY")
req.URL.RawQuery = q.Encode()
resp, _ := client.Do(req)
body, _ := ioutil.ReadAll(resp.Body)
log.Println(string(body))
}
using System;
using System.Net.Http;
class Program
{
static async Task Main()
{
var client = new HttpClient();
var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
query["engine"] = "youtube_search";
query["q"] = "coffee";
query["no_cache"] = "false";
query["api_key"] = "YOUR_API_KEY";
var response = await client.GetAsync(
$"https://serpapi.abcproxy.com/search?{query}"
);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
import java.net.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://serpapi.abcproxy.com/search" +
"?engine=youtube_search" +
"&q=coffee" +
"&no_cache=false" +
"&api_key=YOUR_API_KEY";
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setRequestMethod("GET");
BufferedReader in = new BufferedReader(
new InputStreamReader(conn.getInputStream())
);
String response = in.lines().collect(Collectors.joining());
System.out.println(response);
}
}