Stations
Stations are what binds The Local Universe — they are the basic building blocks of your exploration with The Local Universe. On this page, we'll dive into the different station endpoints you can use to manage stations programmatically. We'll look at how to query, create, update, and delete stations.
Station Object
Represents a station within The Local Universe.
Properties
- Name
id
- Type
- string
- Description
unique id of the station
- Name
nsfw
- Type
- boolean
- Description
whether this station is nsfw
Get Stations
ADMIN ONLY
Returns a list of station objects. Requires StationsRead
permission.
Optional attributes
- Name
page
- Type
- integer
- Description
the page of stations
- Name
limit
- Type
- integer
- Description
number of stations to return
- Name
open
- Type
- boolean
- Description
whether to filter by currently open stations
Request
curl -G https://api.localuniverse.io/v1/stations \
-H "Authorization: Bearer {token}" \
-d page=1 \
-d limit=10
Response
{
[
{
"id": "1b0fec477b026620",
"nsfw": false,
"created_at": 692233200,
"updated_at": 692233200
},
{
"id": "c5027b5717d97178",
// ..
}
]
}
Create Station
ADMIN ONLY
Create a station. Returns a station object. Requires StationsWrite
permission.
Fires a STATION_CREATE
Portal event.
Required attributes
- Name
id
- Type
- string
- Description
the page of stations to return
- Name
nsfw
- Type
- boolean
- Description
whether this station is nsfw
- Name
origin
- Type
- string
- Description
origin of the url of this station
Request
curl -G https://api.localuniverse.io/v1/stations \
-H "Authorization: Bearer {token}" \
-d id="af3dfef97293d250" \
-d origin="https://localuniverse.io" \
-d nsfw=false
Response
{
"id": "af3dfef97293d250",
"nsfw": false,
"created_at": 692233200,
"updated_at": 692233200
}
Get Station
ADMIN ONLY
Get a station by ID. Returns a station object. Requires StationsRead
permission.
Request
curl -G https://api.localuniverse.io/v1/stations/8e58de057e633fb9 \
-H "Authorization: Bearer {token}"
Response
{
"id": "8e58de057e633fb9",
"nsfw": false,
"created_at": 692233200,
"updated_at": 692233200
}
Get Station Frequencies
ADMIN ONLY
Retrieves the frequencies in a station. Returns a list of frequency object. Requires FrequenciesRead
permission.
Optional attributes
- Name
page
- Type
- integer
- Description
the page of frequencies to return
- Name
limit
- Type
- integer
- Description
number of frequencies to return
- Name
open
- Type
- boolean
- Description
whether to filter by currently open frequencies
Request
curl -G https://api.localuniverse.io/v1/stations/8e58de057e633fb9/frequencies \
-H "Authorization: Bearer {token}"
Response
{
[
{
"id": "1b0fec477b026620",
"station_id": "8e58de057e633fb9",
"nsfw": false,
"created_at": 692233200,
"updated_at": 692233200
},
{
"id": "c5027b5717d97178",
// ..
}
]
}
Create Station Frequency
ADMIN ONLY
Create a frequency. Returns a frequency object. Requires FrequenciesWrite
permission.
Fires a FREQUENCY_CREATE
Portal event.
Required attributes
- Name
id
- Type
- string
- Description
id of this frequency
- Name
nsfw
- Type
- boolean
- Description
whether this frequency is nsfw
- Name
path
- Type
- string
- Description
pathname of the url of this frequency
Request
curl -G https://api.localuniverse.io/v1/stations/8e58de057e633fb9/frequencies \
-H "Authorization: Bearer {token}" \
-d id="12345" \
-d path="/watch?v=Kdky9Hm1" \
-d nsfw=false
Response
{
"id": "af3dfef97293d250",
"station_id": "8e58de057e633fb9",
"nsfw": false,
"created_at": 692233200,
"updated_at": 692233200
}