Skip to main content
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);
{
  "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
  }
}
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

age
integer
required

Response

Age-appropriate ratings across all systems

age
integer

Child's age in years, derived from birth_date.

ratings
object

Map of rating-system slug to the age-appropriate Rating in that system.