Contents
On this page

List Categories and Tags - Plugixa Video

GET /pvx/v1/terms

List the video categories, or the video tags, with their counts. This is what the browse filters use.

Public.

Note. Empty categories and tags are listed too. The list is not paged and stops at 500 terms.

Request

GET https://your-site.example/wp-json/pvx/v1/terms?taxonomy=pvx_category

Query parameters

Name Type Default Description
taxonomy string pvx_category pvx_category for categories, pvx_tag for tags.

This endpoint takes no other list parameters.

Responses

200 OK. data is every term of the taxonomy.

{
  "success": true,
  "data": [
    {
      "id": 14,
      "name": "Travel",
      "slug": "travel",
      "parent": 0,
      "count": 23,
      "link": "https://your-site.example/video-category/travel/"
    }
  ]
}
Field Type Meaning
data[].id integer The term id, as used by category and tag in List Videos
data[].name string The name, unescaped
data[].slug string The URL name
data[].parent integer Parent category id, 0 at the top level
data[].count integer Published videos using it, as WordPress counts them
data[].link string The archive page

Errors

Status Code When
400 rest_invalid_param taxonomy is neither pvx_category nor pvx_tag.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/pvx/v1/terms?taxonomy=pvx_category"
<?php
$query = http_build_query([
    'taxonomy' => 'pvx_category',
]);
$ch = curl_init('https://your-site.example/wp-json/pvx/v1/terms?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const query = new URLSearchParams({ taxonomy: "pvx_category" });
const response = await fetch(`https://your-site.example/wp-json/pvx/v1/terms?${query}`);
const { data } = await response.json();

Quick Links

Share