Search suggestions
curl --request GET \
--url https://spotify-api31.p.rapidapi.com/api/v1/suggestions \
--header 'x-rapidapi-key: <api-key>'import requests
url = "https://spotify-api31.p.rapidapi.com/api/v1/suggestions"
headers = {"x-rapidapi-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-rapidapi-key': '<api-key>'}};
fetch('https://spotify-api31.p.rapidapi.com/api/v1/suggestions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://spotify-api31.p.rapidapi.com/api/v1/suggestions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-rapidapi-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://spotify-api31.p.rapidapi.com/api/v1/suggestions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-rapidapi-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://spotify-api31.p.rapidapi.com/api/v1/suggestions")
.header("x-rapidapi-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://spotify-api31.p.rapidapi.com/api/v1/suggestions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-rapidapi-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"suggestions": [
{
"type": "text",
"suggestion": "despacito justin bieber",
"uri": "spotify:search:despacito+justin+bieber"
},
{
"type": "text",
"suggestion": "despacito",
"uri": "spotify:search:despacito"
},
{
"type": "track",
"id": "6habFhsOp2NvshLv26DqMb",
"name": "Despacito",
"uri": "spotify:track:6habFhsOp2NvshLv26DqMb",
"duration": 229360,
"artists": [
{
"name": "Luis Fonsi",
"uri": "spotify:artist:4V8Sr092TqfHkfAA5fXXqG"
}
]
},
{
"type": "album",
"id": "3Gq2Dme9nesdgoqNNlcN8O",
"name": "Despacito Feat. Justin Bieber (Remix)",
"uri": "spotify:album:3Gq2Dme9nesdgoqNNlcN8O",
"artists": [
{
"name": "Luis Fonsi",
"uri": "spotify:artist:4V8Sr092TqfHkfAA5fXXqG"
}
],
"coverArt": [
{
"url": "https://i.scdn.co/image/ab67616d00001e02a6a335d613d151c626895a83",
"width": 300,
"height": 300
}
]
}
]
},
"message": "Success",
"statusCode": 200,
"pagination": {
"total": 100,
"hasMore": true,
"continuation": "CDsQ8FsiEwje95_F1pmRAxXlsykDHUX"
}
}{
"message": "Bad request"
}{
"message": "Invalid API key"
}{
"message": "You are not subscribed to this API, please subscribe before using"
}{
"success": false,
"message": "Internal Server Error",
"status_code": 500,
"cost": 0,
"explain": "Internal Server Error"
}Explore
Search suggestions
Get search suggestions based on keyword input
GET
/
api
/
v1
/
suggestions
Search suggestions
curl --request GET \
--url https://spotify-api31.p.rapidapi.com/api/v1/suggestions \
--header 'x-rapidapi-key: <api-key>'import requests
url = "https://spotify-api31.p.rapidapi.com/api/v1/suggestions"
headers = {"x-rapidapi-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-rapidapi-key': '<api-key>'}};
fetch('https://spotify-api31.p.rapidapi.com/api/v1/suggestions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://spotify-api31.p.rapidapi.com/api/v1/suggestions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-rapidapi-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://spotify-api31.p.rapidapi.com/api/v1/suggestions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-rapidapi-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://spotify-api31.p.rapidapi.com/api/v1/suggestions")
.header("x-rapidapi-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://spotify-api31.p.rapidapi.com/api/v1/suggestions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-rapidapi-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"suggestions": [
{
"type": "text",
"suggestion": "despacito justin bieber",
"uri": "spotify:search:despacito+justin+bieber"
},
{
"type": "text",
"suggestion": "despacito",
"uri": "spotify:search:despacito"
},
{
"type": "track",
"id": "6habFhsOp2NvshLv26DqMb",
"name": "Despacito",
"uri": "spotify:track:6habFhsOp2NvshLv26DqMb",
"duration": 229360,
"artists": [
{
"name": "Luis Fonsi",
"uri": "spotify:artist:4V8Sr092TqfHkfAA5fXXqG"
}
]
},
{
"type": "album",
"id": "3Gq2Dme9nesdgoqNNlcN8O",
"name": "Despacito Feat. Justin Bieber (Remix)",
"uri": "spotify:album:3Gq2Dme9nesdgoqNNlcN8O",
"artists": [
{
"name": "Luis Fonsi",
"uri": "spotify:artist:4V8Sr092TqfHkfAA5fXXqG"
}
],
"coverArt": [
{
"url": "https://i.scdn.co/image/ab67616d00001e02a6a335d613d151c626895a83",
"width": 300,
"height": 300
}
]
}
]
},
"message": "Success",
"statusCode": 200,
"pagination": {
"total": 100,
"hasMore": true,
"continuation": "CDsQ8FsiEwje95_F1pmRAxXlsykDHUX"
}
}{
"message": "Bad request"
}{
"message": "Invalid API key"
}{
"message": "You are not subscribed to this API, please subscribe before using"
}{
"success": false,
"message": "Internal Server Error",
"status_code": 500,
"cost": 0,
"explain": "Internal Server Error"
}Was this page helpful?
⌘I

