Contents
Search TMDB - Plugixa Stream
GET /plugixa-stream/v1/admin/tmdb/search
Look up a title on TMDB before importing it.
Needs a user with the plugixa_stream_create and plugixa_stream_edit capabilities and WordPress’s upload_files (signed in with an Application Password or the login cookie).
Request
GET https://your-site.example/wp-json/plugixa-stream/v1/admin/tmdb/search?query=sintel&kind=movie
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
query |
string |
Yes | The title to look for. |
kind |
string |
Yes | movie or tv. |
Responses
200 OK.
{
"success": true,
"data": [
{
"id": 45745,
"title": "Sintel",
"year": "2010",
"overview": "A lonely young woman, Sintel, helps and befriends a dragon.",
"poster": "https://image.tmdb.org/t/p/w185/4BMG9hk9NvSBeQvC82sVmVRK140.jpg"
}
]
}
| Field | Type | Meaning |
|---|---|---|
data[].id |
integer |
The TMDB id, for preview and import |
data[].title |
string |
Its title |
data[].year |
string |
First four characters of its date, or empty |
data[].overview |
string |
TMDB’s synopsis |
data[].poster |
string |
A small poster on TMDB’s servers, or empty |
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_stream_forbidden |
The caller lacks one of the three capabilities. |
422 |
plugixa_stream_invalid |
query is blank or kind is not movie or tv. |
422 |
plugixa_stream_tmdb_key |
No TMDB key is saved, or TMDB refused it. |
502 |
plugixa_stream_tmdb |
TMDB could not be reached or answered oddly. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-stream/v1/admin/tmdb/search?query=sintel&kind=movie" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/tmdb/search?query=sintel&kind=movie');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/admin/tmdb/search?query=sintel&kind=movie', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share