A plugin is a web service that tells photon-server about films and shows, keeps lists of them, or streams them. It can be written in any language and run anywhere the server can reach over HTTP. An admin registers it by its address; from then on it is a provider like the built-in TMDB, TheTVDB and MDBList: it is listed among the providers, takes settings such as an API key, and a library can take metadata from it, ranked where the admin puts it, or play the streams it offers for the titles of a list.
This page is the protocol, for a plugin’s author. Registering a plugin, setting it up, ranking it in a library and removing it are the admin’s, in Install and manage plugins.
This is protocol version 1.
Calls
Every call but the manifest is a POST of a JSON body, answered 200 OK with a JSON body.
- Settings. Every request carries
settings: what the admin set for the plugin, by key. A plugin is not called at all while a setting it marksrequiredis unset. Secrets are never shown to admins again once set, and never logged by the server. - Locale. A match, describe, search or person request carries
language, an IETF tag such asen-GBthat its words are wanted in, andcountry, an ISO 3166-1 alpha-2 code such asGBwhose certificates are wanted: the title’s library’s, or the server’s own. Either may be absent.artworkislocalizedfor pictures in that language first, oranyfor the most liked. - Ids are maps from a provider to the title’s or person’s id there:
imdb,tmdb,tvdb, and the plugin’s own,plugin:{id}, once it has given one. - Kinds are
movieandshow. A plugin is asked only about the kinds its manifest names. - Errors. Answer a
4xxor5xxstatus, with an RFC 9457 problem (application/problem+json,{"title": "…", "detail": "…"}) where there is something to say. A5xx, a timeout or no answer at all is a plugin that is down: the server passes over it to the library’s next source, as it does a provider whose key is not set. A4xxfrom adescribecall fails the title’s job, which an admin sees and can retry; from arateorpersoncall it is logged and the title or person goes without. - Limits. Each call has 20 seconds and may answer at most 8 MiB. A redirect is not followed: it is answered as a refusal, as the server asks only the address the plugin was registered at.
- Anything the server has no name for (a kind of picture, a rating site, a credit kind) is left
out, as is a field left out of the answer. A picture is a
httporhttpsURL the server fetches and caches itself, as it does TMDB’s.
GET /manifest
{
"protocol": 1,
"id": "films",
"name": "Films Database",
"kinds": ["movie", "show"],
"capabilities": [
{"name": "describe", "version": 1},
{"name": "search", "version": 1},
{"name": "rate", "version": 1},
{"name": "person", "version": 1},
{"name": "list", "version": 1},
{"name": "stream", "version": 1},
{"name": "subtitles", "version": 1},
{"name": "events", "version": 1, "events": ["playback.started", "playback.stopped"]},
{"name": "segments", "version": 1},
{"name": "request", "version": 1},
{"name": "pages", "version": 1, "pages": [{"id": "ask", "name": "Ask for a film", "url": "/ui", "access": "everyone"}]}
],
"settings": [
{"key": "api_key", "name": "API key", "secret": true, "required": true},
{"key": "region", "name": "Region"}
]
} idis the plugin’s slug: lower case letters, digits and hyphens, starting with a letter or digit, at most 63 characters. It may not change between manifests.capabilitiesare what the plugin answers, each at a version of it. A capability’s calls arePOST /{name}/v{version}/{call}:describeismatchanddescribe,searchissearch,rateisratings,personisperson,listislist,streamisstreams,subtitlesissearchandfetch,eventsisevent,segmentsismarkers,requestisrequest;pageshas no call, as its pages are visited. Leave a capability out and it is never called.- A capability the server does not speak, by name or at that version, is passed over, and a plugin that answers none it speaks is refused. So a plugin can name one at two versions, or one only a newer server speaks, and be registered by any server for what that server speaks.
POST /describe/v1/match
Find the title the server has. Where ids carries the plugin’s own id, given before or pinned by
an admin, answer it. Answer an empty id when there is no confident match: a wrong match is worse
than none.
{
"settings": {"api_key": "…"},
"language": "en-GB",
"country": "GB",
"kind": "movie",
"title": "Jaws",
"year": 1975,
"ids": {"imdb": "tt0073195"}
} {"id": "jaws-1"} POST /describe/v1/describe
Say what is known of the title matched. For a show, seasons are the seasons the server wants,
numbered in order (aired, dvd, absolute, or group as the TMDB episode group whose id is episode_group numbers them); describe those you have, and none in an order you cannot number
them in. A season_scope of every, which a show in a remote library has no files to number
seasons by is asked with, wants every season you have; numbered, or none, wants those in seasons.
{
"settings": {"api_key": "…"},
"language": "en-GB",
"country": "GB",
"kind": "show",
"id": "wire-7",
"seasons": [1, 2],
"order": "aired"
} {
"title": "The Wire",
"sort_title": "Wire",
"original_title": "The Wire",
"overview": "Baltimore, from both sides of the law.",
"tagline": "Listen carefully.",
"certificate": "15",
"release_date": "2002-06-02",
"year": 2002,
"genres": ["Crime", "Drama"],
"studios": ["HBO"],
"ids": {"imdb": "tt0306414", "tmdb": "1438", "plugin:films": "wire-7"},
"artwork": [
{"kind": "poster", "url": "https://img.example/wire.jpg", "language": "en", "width": 1000, "height": 1500},
{"kind": "backdrop", "url": "https://img.example/wire-wide.jpg"}
],
"videos": [
{"kind": "trailer", "site": "YouTube", "key": "9qK-VGjMr8g", "name": "Trailer", "language": "en",
"published": "2008-01-01T00:00:00Z"}
],
"credits": [
{"name": "Dominic West", "ids": {"tmdb": "17178", "plugin:films": "west"},
"photo": "https://img.example/west.jpg", "kind": "actor", "role": "Jimmy McNulty"},
{"name": "David Simon", "ids": {"tmdb": "5714"}, "kind": "creator"}
],
"seasons": [
{
"number": 1,
"title": "Season 1",
"overview": "The Barksdale organisation.",
"artwork": [{"kind": "poster", "url": "https://img.example/wire-s1.jpg"}],
"episodes": [
{"number": 1, "title": "The Target", "release_date": "2002-06-02",
"artwork": [{"kind": "thumb", "url": "https://img.example/wire-1x01.jpg"}]}
]
}
]
} Every field is optional. A season and an episode are described by the same fields as a title,
besides number; of them the server keeps the fields and pictures, and an episode’s credits.
artworkkinds:poster,backdrop,logo,thumb,banner, best first.videosare links to videos hosted elsewhere. Kinds:trailer,teaser,featurette,behind_the_scenes,deleted_scene,interview,scene,short,clip,blooper,theme_video,other. A library keeps only the kinds it is set to.creditskinds:actor,guest_star,director,writer,producer,composer,creator. The server knows a person by any of theirids, your own included: two credits sharing an id, from any source, are one person, who gains the ids each brings. A credit with no ids is not kept.idsare kept on the title, so the next match is handed them; give your own asplugin:{id}.
POST /search/v1/search
List titles by a name, for an admin choosing a match by hand. The admin’s choice is pinned as the plugin’s own id, and the title matched again with it.
{"settings": {"api_key": "…"}, "kind": "movie", "title": "Jaws", "year": 1975} {
"results": [
{"id": "jaws-1", "title": "Jaws", "original_title": "Jaws", "year": 1975,
"poster": "https://img.example/jaws.jpg"}
]
} POST /rate/v1/ratings
Say what sites’ readers and critics make of a title, found by its ids. Scores are out of 100,
whatever scale the site uses (IMDb’s 8.1 is 81). Sites: imdb, tmdb, rotten_tomatoes, rotten_tomatoes_audience; any other is dropped.
{"settings": {"api_key": "…"}, "kind": "movie", "ids": {"imdb": "tt0073195", "tmdb": "578"}} {"ratings": [{"site": "imdb", "score": 81, "votes": 640000}, {"site": "rotten_tomatoes", "score": 97}]} POST /person/v1/person
Say what is known of someone a title credits, found by their ids. Answer 404 for someone the
plugin does not know.
{"settings": {"api_key": "…"}, "ids": {"tmdb": "17178", "plugin:films": "west"}} {
"name": "Dominic West",
"biography": "An English actor.",
"born": "1969-10-15",
"birthplace": "Sheffield, England",
"photo": "https://img.example/west.jpg"
} died is a date like born, where there is one.
POST /list/v1/list
Answer a list’s films or shows, in its order: the titles a collection holds, or a remote library
plays. A list is named as the plugin names its lists; an admin gives that name as the list’s id.
Answer 404 for a list the plugin does not have. A title of a kind the manifest does not name, or
with no ids, is left out.
{"settings": {"api_key": "…"}, "id": "best-of-1995"} {"titles": [{"kind": "movie", "ids": {"imdb": "tt0113277"}, "title": "Heat", "year": 1995}]} POST /stream/v1/streams
Answer the copies the plugin streams of a film, by its ids, or of an episode, by its show’s ids and
its season and episode, best first; a remote library plays them. url is where the bytes are
now, http or https, which may be the plugin’s own host though it is not public; it may change
each time, and is never kept. key is which bytes they are, the same each time they are offered,
as a file’s name and size: a stream with no key, or no web address, is left out.
{"settings": {"api_key": "…"}, "kind": "show", "ids": {"imdb": "tt0306414"}, "season": 1, "episode": 1} {
"streams": [
{"key": "file:The.Wire.S01E01.mkv:1503238553", "url": "http://films-plugin.local:9000/play/abc",
"name": "The Wire S01E01 1080p", "filename": "The.Wire.S01E01.mkv", "size": 1503238553}
]
} POST /subtitles/v1/search
Answer the subtitles the plugin has for a film, by its ids, or an episode, by its show’s ids and
its numbers, in language, an IETF tag such as en or pt-BR. hash is the file’s OpenSubtitles hash,
where the copy is one file; mark a subtitle made for that very file for_release. The server lists
those first, then the most downloaded, beside other providers’ for a viewer to pick from, and
fetches the first that a library’s settings want for titles that have none.
{"settings": {"api_key": "…"}, "kind": "movie", "ids": {"imdb": "tt0113277"}, "hash": "8e245d9679d31e12", "language": "en"} {
"subtitles": [
{"id": "7", "language": "en", "release": "Heat.1995.1080p.BluRay", "hearing_impaired": false,
"forced": false, "for_release": true, "downloads": 1200}
]
} POST /subtitles/v1/fetch
Answer a subtitle search found, by its id, as SubRip.
{"settings": {"api_key": "…"}, "id": "7"} {"subrip": "1\n00:00:01,000 --> 00:00:04,000\nWhat are you, a cop?\n"} POST /events/v1/event
Be told of what happens on the server, as a webhook is: events names the kinds the plugin hears,
of playback.started, playback.paused, playback.resumed, playback.stopped, auth.signed_in, auth.sign_in_refused, profile.added, profile.removed, library.added, library.removed, library.scanned, library.titles_added, task.failed and backup.made; any
other is passed over. An event is queued as it happens and sent once, with the plugin’s settings as
they are when it is sent. Answer 2xx, for an event the plugin acted on or ignored alike: anything
else, or no answer in 10 seconds, is tried again later, waiting longer each time, five times in
all.
A redirect is not followed.
{
"settings": {"token": "…"},
"event": {
"event": "playback.started",
"at": "2026-10-09T20:15:00Z",
"server": {"id": "0199c6f2-…", "name": "Den"},
"profile": {"id": "0199c6f2-…", "name": "Oliver"},
"title": {"id": "0199c6f2-…", "kind": "movie", "title": "Heat", "year": 1995, "ids": {"imdb": "tt0113277"}},
"details": {"playback": {"method": "direct"}}
}
} profile, title and library are there where the event is about one that still is. A title
carries its IMDb, TMDB and TheTVDB ids, and an episode its season, episode and show, as a
scrobbler finds it by. details are the event’s own, as the webhook of its kind is sent them.
POST /segments/v1/markers
Time the intro, credits, recap and preview of a copy of a film, by its ids, or of an episode, by
its show’s ids and its numbers, as a database of them timed by hand for each release does. duration_ms is the copy’s length: a cut of another length has other timings, so answer none
for one the plugin has no timing of. A copy in several files is not asked about.
{"settings": {"api_key": "…"}, "kind": "show", "ids": {"tvdb": "73739"}, "season": 1, "episode": 3, "duration_ms": 2640000} {"markers": [{"kind": "intro", "start_ms": 60000, "end_ms": 120000}, {"kind": "credits", "start_ms": 2580000, "end_ms": 2640000}]} Each part is asked about once, as the detect_markers task runs in the maintenance window, where a
library offers markers: on chapters or all. A player is offered the plugin’s below what an admin
set and what the file’s chapters name, and above what the server finds by comparing sound or
reading pictures. A stretch outside the copy, of a kind the server has no name for, or a second of a
kind, is dropped.
POST /request/v1/request
Fetch a film, or a show’s seasons (every one where none are named), that a library lacks and a
profile asked for, as Radarr, Sonarr or riven does. It comes with every id the library’s search
knows the title by. id is the request’s, the same each time it is sent: a plugin that has taken
it on already answers as it did. Answer {} once the plugin has taken it on.
{"settings": {"api_key": "…"}, "id": "0199d1b2-0000-7000-8000-000000000001", "kind": "show",
"ids": {"tmdb": "1396", "tvdb": "81189", "imdb": "tt0903747"}, "title": "Breaking Bad", "year": 2008, "seasons": [1, 2]} {} A library sends its requests to the plugin once an admin names it as where they go (the library’s requests), and a request is sent once an admin, or the manager that keeps the profile that
asked, approves it. A 4xx marks the request failed with the plugin’s words, for an admin to
approve again or decline; a 5xx, a timeout or no answer is tried again later. The library holds
the title once a scan finds it in its folder: the plugin is never asked how it is getting on.
Pages
A plugin serves pages of its own, on its own origin, that the server’s menus link to: pages names each by an id (lower case letters, digits and hyphens), its name in the menu, its url (an http or https address, or a path under the plugin’s), and its access: admin for the
admins, everyone for every profile signed in. The page is never served from the server’s origin,
so nothing on it can read a profile’s session there.
A profile opening a page is sent to its url with a code in its fragment, as https://requests.example/ui#photon_visit=…, which no server is sent and no log keeps. The page
hands the code to the plugin, which claims it of the server, once, within a minute, to know who
visits:
curl -X POST "$PHOTON_URL/api/v1/plugins/requests/visits/claim" -d '{"code": "…"}' {"page": "ask", "profile": {"id": "0199c6f2-…", "name": "Kid", "role": "user"}} A code claimed already, lapsed, or of another plugin’s page is answered 404. The plugin keeps
its own session for the profile from then on.
Calling the server
A plugin that acts on the server, rather than only answering it (one that scans a folder a
download landed in, or sets an episode’s markers), calls its API as any client does, with an API
key: declare the server’s address and a key as settings, the key secret, and the admin makes one
under Settings › Server › API keys and sets both.
"settings": [
{"key": "photon_url", "name": "photon-server address", "required": true},
{"key": "photon_key", "name": "photon-server API key", "secret": true, "required": true}
] # scan the folder of a library a download landed in
curl -X POST "$PHOTON_URL/api/v1/admin/libraries/$LIBRARY_ID/scan?path=/srv/films/Heat%20(1995)" -H "Authorization: Bearer $PHOTON_KEY" A key acts as the admin who made it, as Jellyfin’s and Emby’s do, and stands until it is revoked
there; revoke it when the plugin is removed. The API is described at GET /api/v1/openapi.json.
A plugin is a service that runs on its own, so it keeps its own schedule: the server runs no task of a plugin’s, as Jellyfin does for its plugins, which have no process of their own.
Nor does a plugin check passwords, as Jellyfin’s LDAP plugin does: a directory signs the household in through OpenID Connect, by Authentik, Keycloak or Authelia in front of it, and a Jellyfin app whose profile has no password signs in by pairing.
Versions
The manifest’s protocol is the version of the manifest and of what every call shares (settings,
locale, ids, errors); the server registers only plugins that speak one it does. Each capability has
a version of its own: a change to one capability’s calls is a new version of it, and changes
nothing for a plugin that does not answer it. A new capability is no new version of anything.
Within a version the server may add optional fields to what it sends, so a plugin ignores fields it does not know, and a plugin may leave out any optional field. Anything a plugin could notice otherwise (a field renamed, removed or newly required, a changed meaning) is a new version.
Stremio addons
A Stremio addon is registered as a plugin too, and speaks Stremio’s own protocol rather than this one: its catalogs are lists and its streams are copies a remote library plays. See Stremio addons.