SDK (@phosra/sdk)
import { PhosraClient } from "@phosra/sdk";
const phosra = new PhosraClient({
baseUrl: "https://phosra-api-sandbox-production.up.railway.app/api/v1",
accessToken: process.env.PHOSRA_API_KEY,
});
const result = await phosra.ratings.systems();
console.log(result);curl -sS "https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems"
import requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.get(
f"{BASE}/ratings/systems",
)
print(res.status_code, res.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
base := "https://phosra-api-sandbox-production.up.railway.app/api/v1"
req, _ := http.NewRequest("GET", base+"/ratings/systems", nil)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "csm",
"name": "Common Sense Media",
"country": "US",
"media_type": "general",
"description": "Common Sense Media age-based ratings"
},
{
"id": "esrb",
"name": "ESRB",
"country": "US",
"media_type": "game",
"description": "Entertainment Software Rating Board"
}
]{
"error": "Unauthorized",
"message": "missing or invalid Authorization header",
"code": 401
}{
"error": "Too Many Requests",
"message": "rate limit exceeded",
"code": 429
}{
"error": "Internal Server Error",
"message": "internal error",
"code": 500
}Ratings
List rating systems
List all content rating systems (MPAA, TV, ESRB, PEGI, CSM).
GET
/
ratings
/
systems
SDK (@phosra/sdk)
import { PhosraClient } from "@phosra/sdk";
const phosra = new PhosraClient({
baseUrl: "https://phosra-api-sandbox-production.up.railway.app/api/v1",
accessToken: process.env.PHOSRA_API_KEY,
});
const result = await phosra.ratings.systems();
console.log(result);curl -sS "https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems"
import requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.get(
f"{BASE}/ratings/systems",
)
print(res.status_code, res.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
base := "https://phosra-api-sandbox-production.up.railway.app/api/v1"
req, _ := http.NewRequest("GET", base+"/ratings/systems", nil)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "csm",
"name": "Common Sense Media",
"country": "US",
"media_type": "general",
"description": "Common Sense Media age-based ratings"
},
{
"id": "esrb",
"name": "ESRB",
"country": "US",
"media_type": "game",
"description": "Entertainment Software Rating Board"
}
]{
"error": "Unauthorized",
"message": "missing or invalid Authorization header",
"code": 401
}{
"error": "Too Many Requests",
"message": "rate limit exceeded",
"code": 429
}{
"error": "Internal Server Error",
"message": "internal error",
"code": 500
}Rating systems are the content-classification vocabularies Phosra maps against — MPAA, ESRB, PEGI,
Common Sense Media, and the US TV Parental Guidelines. This endpoint is public; use it to
discover the
id you pass to the other ratings endpoints.
curl https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/systems
Example response (live sandbox)
[
{ "id": "csm", "name": "Common Sense Media", "country": "US", "media_type": "general", "description": "Common Sense Media age-based ratings" },
{ "id": "esrb", "name": "ESRB", "country": "US", "media_type": "game", "description": "Entertainment Software Rating Board" },
{ "id": "mpaa", "name": "MPAA", "country": "US", "media_type": "movie", "description": "Motion Picture Association of America film rating system" },
{ "id": "pegi", "name": "PEGI", "country": "EU", "media_type": "game", "description": "Pan European Game Information" },
{ "id": "tvpg", "name": "TV Parental Guidelines", "country": "US", "media_type": "tv", "description": "US television content rating system" }
]
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
⌘I