YouTube Keyword API



Price: 1 credits per request


Description: Discover new keywords related based on the YouTube keyword algorithm.

Query string parameters

Name Parameter Description
Keyword &keyword=

The keyword or phrase is used by the the algorithm to discover keyword suggestions

example: Marketing

Country code &google=

The country code is used to extract the keyword suggestions from the YouTube target region (view the list of available country codes)

example: us

API key &key= Your private API key

Response elements

Name Description
Keyword YouTube keyword suggestion
Keyword type Values: Primary keyword suggestion (Level 1) or Secondary keyword suggestion (Level 2)
Keyword source YouTube
Keyword base The input keyword
Keyword matches The number of times a keyword suggestion was detected

Country codes

Country code Country
us United States
uk United Kingdom
ca Canada
nl Netherlands
de Germany
fr France
es Spain
it Italy
au Australia
nz New Zealand
mx Mexico
ar Argentina
be Belgium
dk Denmark
no Norwegian
se Sweden
ru Russia
be Belgium
dk Denmark
no Norwegian
se Sweden
ru Russia

If your preferred country is not mentioned in this list, please visit the official Google documentation page for all the supported country codes: https://developers.google.com/custom-search/docs/xml_results_appendices#countryCodes

Tool: https://www.seoreviewtools.com/youtube-keyword-tool/


PHP code example

<?php

/*
    API documentation for SEO Review Tools.
    API info: https://www.seoreviewtools.com/seo-api/
    API documentation: https://api.seoreviewtools.com/documentation/
    LinkedIn: https://www.linkedin.com/company/seo-review-tools
*/

// API key 
$apiKey 'YOUR-API-KEY';

// Keyword
$keywordInput "Marketing"

// Country code
$countryCode"us"

// specific API url 
$apiRequestUrl 'https://api.seoreviewtools.com/youtube-keywords-v1-0/?keyword='.urlencode($keyword).'&google='.$countryCode.'&key='.$apiKey;

// get data from API
$jsonReposnse file_get_contents($apiRequestUrl);

// convert JSON to PHP array
$dataArray json_decode($jsonReposnsetrue);

// check if API call is success or failed
// (just some basic validation)

// API call fail
if ($dataArray['status'] !== 'ok'){

    
// return error message
    
echo 'Error message: '.$dataArray['error message'];

// API call success    
} else {

    
// print data
    
print_r($dataArray); 
}

?>

cURL code example

curl -G "https://api.seoreviewtools.com/youtube-keywords-v1-0/" \
  --data-urlencode "keyword=Marketing" \
  --data-urlencode "google=us" \
  --data-urlencode "key=YOUR-API-KEY"

Python code example

import requests
import urllib.parse

# API key
api_key = 'YOUR-API-KEY'

# Keyword
keyword_input = "Marketing"

# Country code
country_code = "us"

# Construct the API request URL
encoded_keyword = urllib.parse.quote(keyword_input)
api_url = f'https://api.seoreviewtools.com/youtube-keywords-v1-0/?keyword={encoded_keyword}&google={country_code}&key={api_key}'

# Make the API request
response = requests.get(api_url)

# Parse JSON response
data = response.json()

# Check for success
if data.get('status') != 'ok':
    print("Error message:", data.get('error message', 'Unknown error'))
else:
    # Print full response
    print(data)

JSON response example







Trusted by →

clients