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.byAge(13);
console.log(result);
curl -sS "https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/by-age?age=13"
import requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.get(
f"{BASE}/ratings/by-age?age=13",
)
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/by-age?age=13", 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/by-age",
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/by-age")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/by-age")
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{
"csm": {
"id": "00000000-0000-0000-0005-000000000004",
"system_id": "csm",
"code": "10+",
"name": "Age 10+",
"description": "Appropriate for ages 10 and up",
"min_age": 10,
"display_order": 4,
"restrictive_idx": 4
},
"esrb": {
"id": "00000000-0000-0000-0003-000000000002",
"system_id": "esrb",
"code": "E10+",
"name": "Everyone 10+",
"description": "Content generally suitable for ages 10 and up",
"min_age": 10,
"display_order": 2,
"restrictive_idx": 2
},
"mpaa": {
"id": "00000000-0000-0000-0001-000000000002",
"system_id": "mpaa",
"code": "PG",
"name": "Parental Guidance",
"description": "Some material may not be suitable for children",
"min_age": 0,
"display_order": 2,
"restrictive_idx": 2
},
"pegi": {
"id": "00000000-0000-0000-0004-000000000002",
"system_id": "pegi",
"code": "7",
"name": "PEGI 7",
"description": "Suitable for ages 7 and older",
"min_age": 7,
"display_order": 2,
"restrictive_idx": 2
},
"tvpg": {
"id": "00000000-0000-0000-0002-000000000004",
"system_id": "tvpg",
"code": "TV-PG",
"name": "Parental Guidance Suggested",
"description": "May contain some material parents find unsuitable",
"min_age": 0,
"display_order": 4,
"restrictive_idx": 2
}
}{
"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
Get ratings for an age
Get ratings for a specific age
GET
/
ratings
/
by-age
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.byAge(13);
console.log(result);
curl -sS "https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/by-age?age=13"
import requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.get(
f"{BASE}/ratings/by-age?age=13",
)
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/by-age?age=13", 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/by-age",
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/by-age")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/by-age")
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{
"csm": {
"id": "00000000-0000-0000-0005-000000000004",
"system_id": "csm",
"code": "10+",
"name": "Age 10+",
"description": "Appropriate for ages 10 and up",
"min_age": 10,
"display_order": 4,
"restrictive_idx": 4
},
"esrb": {
"id": "00000000-0000-0000-0003-000000000002",
"system_id": "esrb",
"code": "E10+",
"name": "Everyone 10+",
"description": "Content generally suitable for ages 10 and up",
"min_age": 10,
"display_order": 2,
"restrictive_idx": 2
},
"mpaa": {
"id": "00000000-0000-0000-0001-000000000002",
"system_id": "mpaa",
"code": "PG",
"name": "Parental Guidance",
"description": "Some material may not be suitable for children",
"min_age": 0,
"display_order": 2,
"restrictive_idx": 2
},
"pegi": {
"id": "00000000-0000-0000-0004-000000000002",
"system_id": "pegi",
"code": "7",
"name": "PEGI 7",
"description": "Suitable for ages 7 and older",
"min_age": 7,
"display_order": 2,
"restrictive_idx": 2
},
"tvpg": {
"id": "00000000-0000-0000-0002-000000000004",
"system_id": "tvpg",
"code": "TV-PG",
"name": "Parental Guidance Suggested",
"description": "May contain some material parents find unsuitable",
"min_age": 0,
"display_order": 4,
"restrictive_idx": 2
}
}{
"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
}Given an age, this returns the recommended rating from every system at once — the fastest way to
map a child’s age onto a concrete rating code per system.
curl "https://phosra-api-sandbox-production.up.railway.app/api/v1/ratings/by-age?age=8"
Example response (live sandbox, truncated)
{
"csm": { "system_id": "csm", "code": "7+", "name": "Age 7+", "min_age": 7, "restrictive_idx": 3 },
"esrb": { "system_id": "esrb", "code": "E", "name": "Everyone", "min_age": 0, "restrictive_idx": 1 }
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
⌘I