Songs API
curl --request GET \
--url https://api.topyappers.com/api/v1/songs \
--header 'x-ty-api-key: <api-key>'import requests
url = "https://api.topyappers.com/api/v1/songs"
headers = {"x-ty-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-ty-api-key': '<api-key>'}};
fetch('https://api.topyappers.com/api/v1/songs', 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://api.topyappers.com/api/v1/songs",
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-ty-api-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://api.topyappers.com/api/v1/songs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-ty-api-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://api.topyappers.com/api/v1/songs")
.header("x-ty-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topyappers.com/api/v1/songs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-ty-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "OK",
"action": "rankings",
"credits_used": 10,
"response": {}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Too many requests",
"retryAfter": 60
}{
"error": "<string>"
}Get Songs Data
Access trending songs data with various actions. Use the action parameter to specify what data to retrieve.
GET
/
api
/
v1
/
songs
Songs API
curl --request GET \
--url https://api.topyappers.com/api/v1/songs \
--header 'x-ty-api-key: <api-key>'import requests
url = "https://api.topyappers.com/api/v1/songs"
headers = {"x-ty-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-ty-api-key': '<api-key>'}};
fetch('https://api.topyappers.com/api/v1/songs', 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://api.topyappers.com/api/v1/songs",
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-ty-api-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://api.topyappers.com/api/v1/songs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-ty-api-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://api.topyappers.com/api/v1/songs")
.header("x-ty-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topyappers.com/api/v1/songs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-ty-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "OK",
"action": "rankings",
"credits_used": 10,
"response": {}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Too many requests",
"retryAfter": 60
}{
"error": "<string>"
}Authorizations
API key for TopYappers API authentication
Query Parameters
The action to perform
Available options:
countries, weeks, date-ranges, rankings, global, new-entries, search, song-history, compare Country code (required for: rankings, new-entries, compare)
Country code (used for: weeks, song-history)
Week in ISO format (YYYY-Www) for rankings and global
First week for comparison (required for: compare)
Second week for comparison (required for: compare)
Song ID (required for: song-history)
Search query (used for: search)
