Indexing

Indexer Profile API Documentation

Welcome to the Indexer Profile API documentation. This API allows you to manage indexer profiles, including creating, retrieving, and listing indexer profiles. The API uses X-API-Key for authentication.

Table of Contents

Authentication

All API requests require an API key for authentication. Include your API key in the X-API-Key header in each request.

X-API-Key: YOUR_API_KEY

Base URL

https://api.play-video.dev

Endpoints

Create Indexer Profile

Create a new indexer profile.

  • URL: /indexer-profile/create
  • Method: POST
  • Headers:
    • Content-Type: application/json
    • X-API-Key: YOUR_API_KEY

Request Body Parameters

NameTypeDescription
namestringThe name of the indexer profile.
configurationobjectThe configuration settings as a JSON object.

Response

  • Status Code: 200 OK
  • Body: The created indexer profile object.
{
  "name": "string",
  "configuration": {...},
  "owner": "string",
  "uuid": "string"
}

Example

import requests
 
url = "https://api.play-video.dev/indexer-profile/create"
headers = {
    "Content-Type": "application/json",
    "X-API-Key": "YOUR_API_KEY"
}
data = {
    "name": "My Indexer Profile",
    "configuration": {
        "setting1": "value1",
        "setting2": "value2"
    }
}
 
response = requests.post(url, headers=headers, json=data)
print(response.json())

Get Indexer Profile

Retrieve a specific indexer profile by UUID.

  • URL: /indexer-profile/{uuid}
  • Method: GET
  • Headers:
    • X-API-Key: YOUR_API_KEY
  • Path Parameters:
    • uuid: The UUID of the indexer profile.

Response

  • Status Code: 200 OK
  • Body: The indexer profile object.
{
  "name": "string",
  "configuration": {...},
  "owner": "string",
  "uuid": "string"
}

Example

Curl
curl -X GET https://api.play-video.dev/indexer-profile/PROFILE_UUID \
  -H "X-API-Key: YOUR_API_KEY"
Python
import requests
 
profile_uuid = "PROFILE_UUID"
url = f"https://api.play-video.dev/indexer-profile/{profile_uuid}"
headers = {
    "X-API-Key": "YOUR_API_KEY"
}
 
response = requests.get(url, headers=headers)
print(response.json())

Get Indexer Profiles

Retrieve a list of all indexer profiles for the authenticated user.

  • URL: /indexer-profiles
  • Method: GET
  • Headers:
    • X-API-Key: YOUR_API_KEY

Response

  • Status Code: 200 OK
  • Body: An array of indexer profile objects.
[
  {
    "name": "string",
    "configuration": {...},
    "owner": "string",
    "uuid": "string"
  },
  ...
]

Example

Curl
curl -X GET https://api.play-video.dev/indexer-profiles \
  -H "X-API-Key: YOUR_API_KEY"
Python
import requests
 
url = "https://api.play-video.dev/indexer-profiles"
headers = {
    "X-API-Key": "YOUR_API_KEY"
}
 
response = requests.get(url, headers=headers)
print(response.json())

Notes

  • Replace YOUR_API_KEY with your actual API key.
  • Replace PROFILE_UUID with the UUID of the indexer profile you are interacting with.
  • The configuration field should be a valid JSON object representing the configuration settings.
  • Error handling is crucial. Be prepared to handle different HTTP status codes and error messages returned by the API.

Common Status Codes

  • 200 OK: The request was successful.
  • 400 Bad Request: The request was malformed or invalid.
  • 401 Unauthorized: Authentication failed or was not provided.
  • 404 Not Found: The requested resource was not found.
  • 500 Internal Server Error: An error occurred on the server.

Examples of Usage

Below are more detailed examples of how to use the API endpoints using both curl and Python's requests library.

Handling Errors

It's important to handle errors gracefully in your application.

Example

import requests
 
profile_uuid = "INVALID_UUID"
url = f"https://api.play-video.dev/indexer-profile/{profile_uuid}"
headers = {
    "X-API-Key": "YOUR_API_KEY"
}
 
response = requests.get(url, headers=headers)
 
if response.status_code == 200:
    print("Success:", response.json())
elif response.status_code == 404:
    print("Error: Indexer profile not found.")
else:
    print(f"Error {response.status_code}: {response.text}")