PHPeerTube - A PHP‑based federated video platform, inspired by PeerTube.

Copyright (C) 2025 Lucentinian Works Co Ltd

API example

List Publicly Available Videos

To retrieve a list of publicly available videos, you can use the following curl command:

curl -X GET "http://localhost/videos?offset=0&limit=20"

This command sends a GET request to the /videos endpoint, requesting a JSON response. The offset parameter specifies the number of videos to skip, and the limit parameter specifies the maximum number of videos to return. The default offset is 0 and the default limit is 20 (or as configured by the server). The limit provided by the client will be capped by the DEFAULT_VIDEO_LIMIT configured on the server.

Filter by Categories

To filter videos by one or more approved categories, include the categories query parameter with a comma-separated list of category slugs. Only videos associated with all the specified approved categories will be returned.

curl -X GET "http://localhost/videos?categories=education,technology&offset=0&limit=20"

This command will retrieve videos that are associated with both the 'education' and 'technology' categories, provided these categories are approved.

Filter by User

To filter videos by a specific user, include the userId query parameter with the ID of the user.

curl -X GET "http://localhost/videos?userId=1&offset=0&limit=20"

This command will retrieve publicly available videos published by the user with ID 1.

Combine Filters

You can combine the userId filter with the categories filter to get videos from a specific user within certain categories.

curl -X GET "http://localhost/videos?userId=1&categories=education,technology&offset=0&limit=20"

This command will retrieve publicly available videos published by the user with ID 1 that are also associated with both 'education' and 'technology' categories.

Example Response

[
    {
        "id": 10,
        "user_id": 2,
        "title": "sobha",
        "description": "large file test",
        "info_hash": "aafc9a1ff83aee7434bbd2c0135989fae0484bcc",
        "file_path": "690039c2c18ba_chunk_69003918976f79.56328945_sobha.mp4",
        "status": "published",
        "views": 0,
        "created_at": "2025-10-28 11:34:28",
        "updated_at": "2025-10-28 11:35:10",
        "categories": [
            {
                "id": 1,
                "name": "Education",
                "slug": "education",
                "status": "approved"
            },
            {
                "id": 2,
                "name": "Technology",
                "slug": "technology",
                "status": "approved"
            }
        ]
    },
    {
        "id": 8,
        "user_id": 2,
        "title": "My Awesome Video",
        "description": "A short description of my video",
        "info_hash": "8b7ae68079f8b0061a5a7a0b72a330f6ab79fa42",
        "file_path": "68ff4ed29f498_file_example_MP4_480_1_5MG.mp4",
        "status": "published",
        "views": 0,
        "created_at": "2025-10-27 18:52:02",
        "updated_at": "2025-10-27 18:53:33",
        "categories": []
    }
]