diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index e313beb..b4ddc90 100644
--- a/.speakeasy/workflow.lock
+++ b/.speakeasy/workflow.lock
@@ -1,13 +1,13 @@
-speakeasyVersion: 1.509.0
+speakeasyVersion: 1.658.2
sources:
merge-code-samples-into-spec:
sourceNamespace: merge-code-samples-into-spec
- sourceRevisionDigest: sha256:b28c0b9e22357a682f336b10552700fc8a8094798cbfcca03dafeeaf2f045ce2
- sourceBlobDigest: sha256:930f342a125400a8bc5ea62a4dfc5fbd47fdfae7ce9f0aff42137f533b32e1de
+ sourceRevisionDigest: sha256:4224026fd13e77a9f098a3c474fd5bdb9e082fd91dfc9e33391f146c590af7d0
+ sourceBlobDigest: sha256:9801f773e37702120b0a2269f79d59f48381ac91ee0d3cb2a79745b76c50591e
tags:
- latest
- - speakeasy-sdk-regen-1727310453
- - 0.0.3
+ - speakeasy-sdk-regen-1741134607
+ - 1.1.1
targets: {}
workflow:
workflowVersion: 1.0.0
diff --git a/openapi-with-code-samples.yaml b/openapi-with-code-samples.yaml
index 3526f7e..cbb17f6 100644
--- a/openapi-with-code-samples.yaml
+++ b/openapi-with-code-samples.yaml
@@ -1,245 +1,231 @@
-openapi: 3.1.0
+openapi: 3.1.1
info:
- version: 0.0.3
- title: Plex-API
- summary: An Open API Spec for interacting with Plex.tv and Plex Media Server
- description: |
- # Plex Media Server OpenAPI Specification
-
- An Open Source OpenAPI Specification for Plex Media Server
-
- Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
-
- ## Documentation
-
- [API Documentation](https://plexapi.dev)
-
- ## SDKs
-
- The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
-
- | Language | Repository | Releases | Other |
- | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
- | Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
- | JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
- | Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
- | Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
- | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
- | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
- | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
- | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
- contact:
- name: Luke Hagar
- url: 'https://www.LukeHagar.com'
- email: Lukeslakemail@gmail.com
+ title: Plex Media Server
+ version: 1.1.1
license:
- url: 'https://opensource.org/license/mit'
- name: MIT
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- - url: '{protocol}://{ip}:{port}'
- description: The full address of your Plex Server
+ - url: "https://{IP-description}.{identifier}.plex.direct:{port}"
variables:
- protocol:
- default: https
- enum:
- - http
- - https
- ip:
- default: 10.10.10.47
+ identifier:
+ description: The unique identifier of this particular PMS
+ default: 0123456789abcdef0123456789abcdef
+ IP-description:
+ description: A `-` separated string of the IPv4 or IPv6 address components
+ default: 1-2-3-4
port:
default: '32400'
+ - url: "{protocol}://{host}:{port}"
+ variables:
+ protocol:
+ description: The network protocol to use. Typically (`http` or `https`)
+ default: http
+ host:
+ description: "The Host of the PMS.\nIf using on a local network, this is the internal IP address of the server hosting the PMS.\nIf using on an external network, this is the external IP address for your network, and requires port forwarding.\nIf using a reverse proxy, this would be the external DNS domain for your network, and requires the proxy handle port forwarding. \n"
+ default: localhost
+ port:
+ description: "The Port number configured on the PMS. Typically (`32400`). \nIf using a reverse proxy, this would be the port number configured on the proxy.\n"
+ default: '32400'
+ - url: "{full_server_url}"
+ variables:
+ full_server_url:
+ description: The full manual URL to access the PMS
+ default: http://localhost:32400
security:
- - accessToken: []
-components:
- securitySchemes:
- accessToken:
- description: Plex Authentication Token
- type: apiKey
- in: header
- name: X-Plex-Token
+ - token:
+ - shared user
+ - admin
+x-speakeasy-globals:
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+tags:
+ - name: Activities
+ description: |
+ Activities provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
+
+ Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.
+
+ Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint.
+ - name: Butler
+ description: The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks.
+ - name: Collections
+ description: API Operations against the Collections
+ - name: Content
+ description: The actual content of the media provider
+ - name: Devices
+ description: |
+ Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are `stream` and `download`. More complex grabbers can have associated devices
+
+ Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The `deviceType`, `serviceType`, and `serviceId` values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below.
+
+ Example SSDP output
+ ```
+
+
+ 1
+ 0
+
+
+ urn:plex-tv:device:Media:1
+ Turing Hopper 3000
+ Plex, Inc.
+ https://plex.tv/
+ Turing Hopper 3000 Media Grabber
+ Plex Media Grabber
+ 1
+ https://plex.tv
+ uuid:42fde8e4-93b6-41e5-8a63-12d848655811
+
+
+ http://10.0.0.5:8088
+ urn:plex-tv:service:MediaGrabber:1
+ urn:plex-tv:serviceId:MediaGrabber
+
+
+
+
+ ```
+
+ - UDN: (string) A UUID for the device. This should be unique across models of a device at minimum.
+ - URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted.
+ - name: Download Queue
+ description: API Operations against the Download Queue
+ - name: DVRs
+ description: |
+ The DVR provides means to watch and record live TV. This section of endpoints describes how to setup the DVR itself
+ - name: EPG
+ description: |
+ The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when
+ - name: Events
+ description: |
+ The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported.
+
+ Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket.
+ - name: General
+ description: General endpoints for basic PMS operation not specific to any media provider
+ - name: Hubs
+ description: The hubs within a media provider
+ - name: Library
+ description: Library endpoints which are outside of the Media Provider API. Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc).
+ - name: Library Collections
+ description: Endpoints for manipulating collections. In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well.
+ x-displayName: 'Library: Collections'
+ - name: Library Playlists
+ description: Endpoints for manipulating playlists.
+ x-displayName: 'Library: Playlists'
+ - name: Live TV
+ description: |
+ LiveTV contains the playback sessions of a channel from a DVR device
+ - name: Log
+ description: Logging mechanism to allow clients to log to the server
+ - name: Play Queue
+ description: "The playqueue feature within a media provider\nA play queue represents the current list of media for playback. Although queues are persisted by the server, they should be regarded by the user as a fairly lightweight, an ephemeral list of items queued up for playback in a session. There is generally one active queue for each type of media (music, video, photos) that can be added to or destroyed and replaced with a fresh queue.\nPlay Queues has a region, which we refer to in this doc (partially for historical reasons) as \"Up Next\". This region is defined by `playQueueLastAddedItemID` existing on the media container. This follows iTunes' terminology. It is a special region after the currently playing item but before the originally-played items. This enables \"Party Mode\" listening/viewing, where items can be added on-the-fly, and normal queue playback resumed when completed. \nYou can visualize the play queue as a sliding window in the complete list of media queued for playback. This model is important when scaling to larger play queues (e.g. shuffling 40,000 audio tracks). The client only needs visibility into small areas of the queue at any given time, and the server can optimize access in this fashion.\nAll created play queues will have an empty \"Up Next\" area - unless the item is an album and no `key` is provided. In this case the \"Up Next\" area will be populated by the contents of the album. This is to allow queueing of multiple albums - since the 'Add to Up Next' will insert after all the tracks. This means that If you're creating a PQ from an album, you can only shuffle it if you set `key`. This is due to the above implicit queueing of albums when no `key` is provided as well as the current limitation that you cannot shuffle a PQ with an \"Up Next\" area.\nThe play queue window advances as the server receives timeline requests. The client needs to retrieve the play queue as the “now playing” item changes. There is no play queue API to update the playing item."
+ - name: Playlist
+ description: Media playlists that can be created and played back
+ - name: Preferences
+ description: API Operations against the Preferences
+ - name: Provider
+ description: Media providers are the starting points for the entire Plex Media Server media library API. It defines the paths for the groups of endpoints. The `/media/providers` should be the only hard-coded path in clients when accessing the media library. Non-media library endpoints are outside the scope of the media provider. See the description in See [the section in API Info](#section/API-Info/Media-Providers) for more information on how to use media providers.
+ - name: Rate
+ description: Operations for rating media items (thumbs up/down, star ratings, etc.)
+ - name: Search
+ description: The search feature within a media provider
+ - name: Status
+ description: The status endpoints give you information about current playbacks, play history, and even terminating sessions.
+ - name: Subscriptions
+ description: |
+ Subscriptions determine which media will be recorded and the criteria for selecting an airing when multiple are available
+ - name: Timeline
+ description: The actions feature within a media provider
+ - name: Transcoder
+ description: API Operations against the Transcoder
+ - name: UltraBlur
+ description: Service provided to compute UltraBlur colors and images.
+ - name: Updater
+ description: |
+ This describes the API for searching and applying updates to the Plex Media Server.
+ Updates to the status can be observed via the Event API.
+x-tagGroups:
+ - name: General
+ tags:
+ - General
+ - Library
+ - Library Playlists
+ - Library Collections
+ - Status
+ - Activities
+ - Updater
+ - Butler
+ - Events
+ - Log
+ - Preferences
+ - Download Queue
+ - UltraBlur
+ - Transcoder
+ - name: Playback & Sessions
+ tags:
+ - Status
+ - Timeline
+ - Play Queue
+ - Transcoder
+ - name: Media Provider
+ tags:
+ - Provider
+ - Content
+ - Hubs
+ - Search
+ - Rate
+ - Playlist
+ - Play Queue
+ - Timeline
+ - name: DVR
+ tags:
+ - DVRs
+ - Devices
+ - EPG
+ - Subscriptions
+ - Live TV
paths:
/:
get:
+ summary: Get PMS info
+ operationId: getServerInfo
+ description: Information about this PMS setup and configuration
tags:
- - Server
- summary: Get Server Capabilities
- description: Get Server Capabilities
- operationId: getServerCapabilities
+ - General
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
responses:
'200':
- description: The Server Capabilities
+ description: OK
content:
application/json:
schema:
- type: object
- properties:
- MediaContainer:
- type: object
- properties:
- size:
- type: number
- allowCameraUpload:
- type: boolean
- allowChannelAccess:
- type: boolean
- allowMediaDeletion:
- type: boolean
- allowSharing:
- type: boolean
- allowSync:
- type: boolean
- allowTuners:
- type: boolean
- backgroundProcessing:
- type: boolean
- certificate:
- type: boolean
- companionProxy:
- type: boolean
- countryCode:
- type: string
- diagnostics:
- type: string
- eventStream:
- type: boolean
- friendlyName:
- type: string
- hubSearch:
- type: boolean
- itemClusters:
- type: boolean
- livetv:
- type: number
- machineIdentifier:
- type: string
- mediaProviders:
- type: boolean
- multiuser:
- type: boolean
- musicAnalysis:
- type: number
- myPlex:
- type: boolean
- myPlexMappingState:
- type: string
- myPlexSigninState:
- type: string
- myPlexSubscription:
- type: boolean
- myPlexUsername:
- type: string
- offlineTranscode:
- type: number
- ownerFeatures:
- type: string
- photoAutoTag:
- type: boolean
- platform:
- type: string
- platformVersion:
- type: string
- pluginHost:
- type: boolean
- pushNotifications:
- type: boolean
- readOnlyLibraries:
- type: boolean
- streamingBrainABRVersion:
- type: number
- streamingBrainVersion:
- type: number
- sync:
- type: boolean
- transcoderActiveVideoSessions:
- type: number
- transcoderAudio:
- type: boolean
- transcoderLyrics:
- type: boolean
- transcoderPhoto:
- type: boolean
- transcoderSubtitles:
- type: boolean
- transcoderVideo:
- type: boolean
- transcoderVideoBitrates:
- type: string
- transcoderVideoQualities:
- type: string
- transcoderVideoResolutions:
- type: string
- updatedAt:
- type: number
- updater:
- type: boolean
- version:
- type: string
- voiceSearch:
- type: boolean
- Directory:
- type: array
- items:
- type: object
- properties:
- count:
- type: number
- key:
- type: string
- title:
- type: string
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ $ref: '#/components/schemas/MediaContainerWithDirectory'
x-codeSamples:
- lang: php
- label: getServerCapabilities
+ label: PlexPHP
source: |-
declare(strict_types=1);
@@ -263,165 +249,295 @@ paths:
// handle response
}
- lang: ruby
- label: getServerCapabilities
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_server_capabilities()\n\nif ! res.object.nil?\n # handle response\nend"
+ label: PlexRuby
+ source: |-
+ require 'plex_ruby_sdk'
+
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
+
+ res = s.server.get_server_capabilities()
+
+ if ! res.object.nil?
+ # handle response
+ end
- lang: go
- label: getServerCapabilities
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Server.GetServerCapabilities(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{})
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.MediaContainerWithDirectory != nil {
+ // handle response
+ }
+ }
- lang: java
- label: getServerCapabilities
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetServerCapabilitiesBadRequest;
- import dev.plexapi.plexapi.models.errors.GetServerCapabilitiesUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetServerInfoRequest;
+ import dev.plexapi.sdk.models.operations.GetServerInfoResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
+ GetServerInfoRequest req = GetServerInfoRequest.builder()
+ .build();
+
+ GetServerInfoResponse res = sdk.general().getServerInfo()
+ .request(req)
.call();
- if (res.object().isPresent()) {
+ if (res.mediaContainerWithDirectory().isPresent()) {
// handle response
}
}
}
- lang: typescript
- label: getServerCapabilities
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.server.getServerCapabilities();
+ const result = await plexAPI.general.getServerInfo({});
- // Handle the result
console.log(result);
}
run();
- '/:/prefs':
+ /:/eventsource/notifications:
get:
+ summary: Connect to Eventsource
+ operationId: getNotifications
+ description: Connect to the event source to get a stream of events
tags:
- - Server
- summary: Get Server Preferences
- description: Get Server Preferences
- operationId: getServerPreferences
+ - Events
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: filter
+ description: |
+ By default, all events except logs are sent. A rich filtering mechanism is provided to allow clients to opt into or out of each event type using the `filters` parameter. For example:
+
+ - `filters=-log`: All event types except logs (the default).
+ - `filters=foo,bar`: Only the foo and bar event types.
+ - `filters=`: All events types.
+ - `filters=-foo,bar`: All event types except foo and bar.
+ in: query
+ schema:
+ type: array
+ items:
+ type: string
responses:
'200':
- description: Server Preferences
+ description: OK
+ content:
+ application/octet-stream:
+ schema:
+ format: binary
+ type: string
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Events.GetNotifications(ctx, operations.GetNotificationsRequest{})
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.ResponseStream != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetNotificationsRequest;
+ import dev.plexapi.sdk.models.operations.GetNotificationsResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ GetNotificationsRequest req = GetNotificationsRequest.builder()
+ .build();
+
+ GetNotificationsResponse res = sdk.events().getNotifications()
+ .request(req)
+ .call();
+
+ if (res.responseStream().isPresent()) {
+ // handle response
+ }
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.events.getNotifications({});
+
+ console.log(result);
+ }
+
+ run();
+ /:/prefs:
+ get:
+ summary: Get all preferences
+ operationId: getAllPreferences
+ description: Get the list of all preferences
+ tags:
+ - Preferences
+ responses:
+ '200':
+ description: OK
content:
application/json:
schema:
- type: object
- properties:
- MediaContainer:
- type: object
- properties:
- size:
- type: integer
- format: int32
- example: 161
- Setting:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- example: EnableDatabaseTrace
- label:
- type: string
- example: ''
- summary:
- type: string
- example: ''
- type:
- type: string
- example: bool
- default:
- type: boolean
- example: false
- value:
- type: boolean
- example: false
- hidden:
- type: boolean
- example: true
- advanced:
- type: boolean
- example: false
- group:
- type: string
- example: ''
- enumValues:
- type: string
- example: '1:admin only|2:everyone'
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ $ref: '#/components/schemas/MediaContainerWithSettings'
x-codeSamples:
- lang: php
- label: getServerPreferences
+ label: PlexPHP
source: |-
declare(strict_types=1);
@@ -445,31 +561,981 @@ paths:
// handle response
}
- lang: ruby
- label: getServerPreferences
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_server_preferences()\n\nif ! res.object.nil?\n # handle response\nend"
+ label: PlexRuby
+ source: |-
+ require 'plex_ruby_sdk'
+
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
+
+ res = s.server.get_server_preferences()
+
+ if ! res.object.nil?
+ # handle response
+ end
- lang: go
- label: getServerPreferences
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Server.GetServerPreferences(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Preferences.GetAllPreferences(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.MediaContainerWithSettings != nil {
+ // handle response
+ }
+ }
- lang: java
- label: getServerPreferences
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetServerPreferencesBadRequest;
- import dev.plexapi.plexapi.models.errors.GetServerPreferencesUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetServerPreferencesResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetAllPreferencesResponse;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetServerPreferencesBadRequest, GetServerPreferencesUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetServerPreferencesResponse res = sdk.server().getServerPreferences()
+ GetAllPreferencesResponse res = sdk.preferences().getAllPreferences()
+ .call();
+
+ if (res.mediaContainerWithSettings().isPresent()) {
+ // handle response
+ }
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+
+ const plexAPI = new PlexAPI();
+
+ async function run() {
+ const result = await plexAPI.preferences.getAllPreferences();
+
+ console.log(result);
+ }
+
+ run();
+ put:
+ summary: Set preferences
+ operationId: setPreferences
+ description: Set a set of preferences in query parameters
+ tags:
+ - Preferences
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: prefs
+ in: query
+ required: true
+ schema:
+ type: object
+ example:
+ FriendlyName: My Server
+ ScheduledLibraryUpdateInterval: 3600
+ sendCrashReports: 1
+ responses:
+ '200':
+ $ref: '#/components/responses/200'
+ '400':
+ description: Attempt to set a preferences that doesn't exist
+ content:
+ text/html: {}
+ '403':
+ description: Attempt to set a preferences that doesn't exist
+ content:
+ text/html: {}
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Preferences.SetPreferences(ctx, operations.SetPreferencesRequest{
+ Prefs: operations.Prefs{},
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.*;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ SetPreferencesRequest req = SetPreferencesRequest.builder()
+ .prefs(Prefs.builder()
+ .build())
+ .build();
+
+ SetPreferencesResponse res = sdk.preferences().setPreferences()
+ .request(req)
+ .call();
+
+ // handle response
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.preferences.setPreferences({
+ prefs: {},
+ });
+
+ console.log(result);
+ }
+
+ run();
+ /:/prefs/get:
+ get:
+ summary: Get a preferences
+ operationId: getPreference
+ description: Get a single preference and value
+ tags:
+ - Preferences
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: id
+ description: The preference to fetch
+ in: query
+ schema:
+ type: string
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/MediaContainerWithSettings'
+ '404':
+ description: No preference with the provided name found.
+ content:
+ text/html: {}
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Preferences.GetPreference(ctx, operations.GetPreferenceRequest{})
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.MediaContainerWithSettings != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetPreferenceRequest;
+ import dev.plexapi.sdk.models.operations.GetPreferenceResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ GetPreferenceRequest req = GetPreferenceRequest.builder()
+ .build();
+
+ GetPreferenceResponse res = sdk.preferences().getPreference()
+ .request(req)
+ .call();
+
+ if (res.mediaContainerWithSettings().isPresent()) {
+ // handle response
+ }
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.preferences.getPreference({});
+
+ console.log(result);
+ }
+
+ run();
+ /:/rate:
+ put:
+ summary: Rate an item
+ operationId: setRating
+ description: |-
+ Set the rating on an item.
+ This API does respond to the GET verb but applications should use PUT
+ tags:
+ - Rate
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: identifier
+ description: The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library`
+ in: query
+ required: true
+ schema:
+ type: string
+ - name: key
+ description: The key of the item to rate. This is the `ratingKey` found in metadata items
+ in: query
+ required: true
+ schema:
+ type: string
+ - name: rating
+ description: The rating to give the item.
+ in: query
+ required: true
+ schema:
+ maximum: 10
+ minimum: 0
+ type: number
+ - name: ratedAt
+ description: The time when the rating occurred. If not present, interpreted as now.
+ in: query
+ required: false
+ schema:
+ type: integer
+ responses:
+ '200':
+ $ref: '#/components/responses/200'
+ '400':
+ description: Bad Request. Can occur when parameters are of the wrong type, missing, or if the `ratedAt` is in the future
+ content:
+ text/html: {}
+ '404':
+ description: Indicates that no library with the provide identifier can be found or no item can be found with the rating key
+ content:
+ text/html: {}
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Rate.SetRating(ctx, operations.SetRatingRequest{
+ Identifier: "",
+ Key: "",
+ Rating: 8722.46,
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.SetRatingRequest;
+ import dev.plexapi.sdk.models.operations.SetRatingResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ SetRatingRequest req = SetRatingRequest.builder()
+ .identifier("")
+ .key("")
+ .rating(8722.46)
+ .build();
+
+ SetRatingResponse res = sdk.rate().setRating()
+ .request(req)
+ .call();
+
+ // handle response
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.rate.setRating({
+ identifier: "",
+ key: "",
+ rating: 8722.46,
+ });
+
+ console.log(result);
+ }
+
+ run();
+ /:/scrobble:
+ put:
+ summary: Mark an item as played
+ operationId: markPlayed
+ description: |-
+ Mark an item as played. Note, this does not create any view history of this item but rather just sets the state as played. The client must provide either the `key` or `uri` query parameter
+ This API does respond to the GET verb but applications should use PUT
+ tags:
+ - Timeline
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: identifier
+ description: The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library`
+ in: query
+ required: true
+ schema:
+ type: string
+ - name: key
+ description: The key of the item to rate. This is the `ratingKey` found in metadata items
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: uri
+ description: The URI of the item to mark as played. See intro for description of the URIs
+ in: query
+ required: false
+ schema:
+ type: string
+ responses:
+ '200':
+ $ref: '#/components/responses/200'
+ '400':
+ description: Bad Request. Can occur when parameters are of the wrong type, or missing
+ content:
+ text/html: {}
+ '404':
+ description: Indicates that no library with the provide identifier can be found or no item can be found with the rating key
+ content:
+ text/html: {}
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Timeline.MarkPlayed(ctx, operations.MarkPlayedRequest{
+ Identifier: "",
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.MarkPlayedRequest;
+ import dev.plexapi.sdk.models.operations.MarkPlayedResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ MarkPlayedRequest req = MarkPlayedRequest.builder()
+ .identifier("")
+ .build();
+
+ MarkPlayedResponse res = sdk.timeline().markPlayed()
+ .request(req)
+ .call();
+
+ // handle response
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.timeline.markPlayed({
+ identifier: "",
+ });
+
+ console.log(result);
+ }
+
+ run();
+ /:/timeline:
+ post:
+ summary: Report media timeline
+ operationId: report
+ description: |
+ This endpoint is hit during media playback for an item. It must be hit whenever the play state changes, or in the absence of a play state change, in a regular fashion (generally this means every 10 seconds on a LAN/WAN, and every 20 seconds over cellular).
+ tags:
+ - Timeline
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: key
+ description: The details key for the item.
+ in: query
+ schema:
+ type: string
+ example: /foo
+ - name: ratingKey
+ description: The rating key attribute for the item.
+ in: query
+ schema:
+ type: string
+ example: xyz
+ - name: state
+ description: The current state of the media.
+ in: query
+ schema:
+ type: string
+ enum:
+ - stopped
+ - buffering
+ - playing
+ - paused
+ example: playing
+ - name: playQueueItemID
+ description: If playing media from a play queue, the play queue's ID.
+ in: query
+ schema:
+ type: string
+ example: 123
+ - name: time
+ description: The current time offset of playback in ms.
+ in: query
+ schema:
+ type: integer
+ example: 0
+ - name: duration
+ description: The total duration of the item in ms.
+ in: query
+ schema:
+ type: integer
+ example: 10000
+ - name: continuing
+ description: When state is `stopped`, a flag indicating whether or not the client is going to continue playing anothe item.
+ in: query
+ schema:
+ $ref: "#/components/schemas/BoolInt"
+ example: 1
+ - name: updated
+ description: Used when a sync client comes online and is syncing media timelines, holds the time at which the playback state was last updated.
+ in: query
+ schema:
+ type: integer
+ example: 14200000
+ - name: offline
+ description: Also used by sync clients, used to indicate that a timeline is being synced from being offline, as opposed to being "live".
+ in: query
+ schema:
+ $ref: "#/components/schemas/BoolInt"
+ example: 1
+ - name: timeToFirstFrame
+ description: Time in seconds till first frame is displayed. Sent only on the first playing timeline request.
+ in: query
+ schema:
+ type: integer
+ example: 1000
+ - name: timeStalled
+ description: Time in seconds spent buffering since last request.
+ in: query
+ schema:
+ type: integer
+ example: 1000
+ - name: bandwidth
+ description: Bandwidth in kbps as estimated by the client.
+ in: query
+ schema:
+ type: integer
+ example: 100
+ - name: bufferedTime
+ description: Amount of time in seconds buffered by client. Omit if computed by `bufferedSize` below.
+ in: query
+ schema:
+ type: integer
+ example: 100
+ - name: bufferedSize
+ description: Size in kilobytes of data buffered by client. Omit if computed by `bufferedTime` above
+ in: query
+ schema:
+ type: integer
+ example: 1024
+ - name: X-Plex-Client-Identifier
+ description: Unique per client.
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: X-Plex-Session-Identifier
+ description: Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs)
+ in: header
+ schema:
+ type: string
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ MediaContainer:
+ allOf:
+ - $ref: '#/components/schemas/ServerConfiguration'
+ - properties:
+ Bandwidths:
+ description: A list of media times and bandwidths when trascoding is using with auto adjustment of bandwidth
+ properties:
+ Bandwidth:
+ items:
+ properties:
+ bandwidth:
+ description: The bandwidth at this time in kbps
+ type: integer
+ resolution:
+ description: The user-friendly resolution at this time
+ type: string
+ time:
+ description: Media playback time where this bandwidth started
+ type: integer
+ type: object
+ type: array
+ type: object
+ terminationCode:
+ description: A code describing why the session was terminated by the server.
+ type: integer
+ terminationText:
+ description: A user friendly and localized text describing why the session was terminated by the server.
+ type: string
+ type: object
+ type: object
+ '400':
+ $ref: '#/components/responses/400'
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Timeline.Report(ctx, operations.ReportRequest{
+ Key: plexgo.Pointer("/foo"),
+ RatingKey: plexgo.Pointer("xyz"),
+ State: operations.StatePlaying.ToPointer(),
+ PlayQueueItemID: plexgo.Pointer("123"),
+ Time: plexgo.Pointer[int64](0),
+ Duration: plexgo.Pointer[int64](10000),
+ Continuing: components.BoolIntOne.ToPointer(),
+ Updated: plexgo.Pointer[int64](14200000),
+ Offline: components.BoolIntOne.ToPointer(),
+ TimeToFirstFrame: plexgo.Pointer[int64](1000),
+ TimeStalled: plexgo.Pointer[int64](1000),
+ Bandwidth: plexgo.Pointer[int64](100),
+ BufferedTime: plexgo.Pointer[int64](100),
+ BufferedSize: plexgo.Pointer[int64](1024),
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.*;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import dev.plexapi.sdk.models.shared.BoolInt;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ ReportRequest req = ReportRequest.builder()
+ .key("/foo")
+ .ratingKey("xyz")
+ .state(State.PLAYING)
+ .playQueueItemID("123")
+ .time(0L)
+ .duration(10000L)
+ .continuing(BoolInt.ONE)
+ .updated(14200000L)
+ .offline(BoolInt.ONE)
+ .timeToFirstFrame(1000L)
+ .timeStalled(1000L)
+ .bandwidth(100L)
+ .bufferedTime(100L)
+ .bufferedSize(1024L)
+ .build();
+
+ ReportResponse res = sdk.timeline().report()
+ .request(req)
.call();
if (res.object().isPresent()) {
@@ -478,680 +1544,175 @@ paths:
}
}
- lang: typescript
- label: getServerPreferences
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
+ import { ReportState } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts, BoolInt } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.server.getServerPreferences();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/:/scrobble':
- get:
- tags:
- - Media
- summary: Mark Media Played
- description: This will mark the provided media key as Played.
- operationId: markPlayed
- parameters:
- - name: key
- description: The media key to mark as played
- in: query
- schema:
- type: number
- example: 59398
- required: true
- responses:
- '200':
- description: Media is marked Played
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: markPlayed
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->media->markPlayed(
- key: 59398
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: markPlayed
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.mark_played(key=59398.0)\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: markPlayed
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Media.MarkPlayed(ctx, 59398)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: markPlayed
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.MarkPlayedBadRequest;
- import dev.plexapi.plexapi.models.errors.MarkPlayedUnauthorized;
- import dev.plexapi.plexapi.models.operations.MarkPlayedResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws MarkPlayedBadRequest, MarkPlayedUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- MarkPlayedResponse res = sdk.media().markPlayed()
- .key(59398d)
- .call();
-
- // handle response
- }
- }
- - lang: typescript
- label: markPlayed
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.media.markPlayed(59398);
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/:/unscrobble':
- get:
- tags:
- - Media
- summary: Mark Media Unplayed
- description: This will mark the provided media key as Unplayed.
- operationId: markUnplayed
- parameters:
- - name: key
- description: The media key to mark as Unplayed
- in: query
- schema:
- type: number
- example: 59398
- required: true
- responses:
- '200':
- description: Media is marked Unplayed
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: markUnplayed
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->media->markUnplayed(
- key: 59398
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: markUnplayed
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.mark_unplayed(key=59398.0)\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: markUnplayed
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Media.MarkUnplayed(ctx, 59398)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: markUnplayed
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.MarkUnplayedBadRequest;
- import dev.plexapi.plexapi.models.errors.MarkUnplayedUnauthorized;
- import dev.plexapi.plexapi.models.operations.MarkUnplayedResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws MarkUnplayedBadRequest, MarkUnplayedUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- MarkUnplayedResponse res = sdk.media().markUnplayed()
- .key(59398d)
- .call();
-
- // handle response
- }
- }
- - lang: typescript
- label: markUnplayed
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.media.markUnplayed(59398);
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/:/progress':
- post:
- tags:
- - Media
- summary: Update Media Play Progress
- description: |
- This API command can be used to update the play progress of a media item.
- operationId: updatePlayProgress
- parameters:
- - name: key
- description: the media key
- in: query
- schema:
- type: string
- required: true
- - name: time
- description: 'The time, in milliseconds, used to set the media playback progress.'
- in: query
- schema:
- type: number
- example: 90000
- required: true
- - name: state
- description: The playback state of the media item.
- in: query
- schema:
- type: string
- example: played
- required: true
- responses:
- '200':
- description: Success - The request was successful.
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: updatePlayProgress
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->media->updatePlayProgress(
- key: '',
- time: 90000,
- state: 'played'
-
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: updatePlayProgress
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.update_play_progress(key=\"\", time=90000.0, state=\"played\")\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: updatePlayProgress
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Media.UpdatePlayProgress(ctx, \"\", 90000, \"played\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: updatePlayProgress
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.UpdatePlayProgressBadRequest;
- import dev.plexapi.plexapi.models.errors.UpdatePlayProgressUnauthorized;
- import dev.plexapi.plexapi.models.operations.UpdatePlayProgressResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws UpdatePlayProgressBadRequest, UpdatePlayProgressUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
- .key("")
- .time(90000d)
- .state("played")
- .call();
-
- // handle response
- }
- }
- - lang: typescript
- label: updatePlayProgress
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.media.updatePlayProgress("", 90000, "played");
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/:/timeline':
- get:
- tags:
- - Video
- summary: Get the timeline for a media item
- description: Get the timeline for a media item
- operationId: getTimeline
- parameters:
- - name: ratingKey
- description: The rating key of the media item
- required: true
- in: query
- schema:
- type: number
- example: 23409
- - name: key
- description: The key of the media item to get the timeline for
- required: true
- in: query
- schema:
- type: string
- example: /library/metadata/23409
- - name: state
- description: The state of the media item
- required: true
- in: query
- schema:
- type: string
- enum:
- - playing
- - paused
- - stopped
- example: playing
- - name: hasMDE
- description: Whether the media item has MDE
- required: true
- in: query
- schema:
- type: number
- example: 1
- - name: time
- description: The time of the media item
- required: true
- in: query
- schema:
- type: number
- example: 2000
- - name: duration
- description: The duration of the media item
- required: true
- in: query
- schema:
- type: number
- example: 10000
- - name: context
- description: The context of the media item
- required: true
- in: query
- schema:
- type: string
- example: 'home:hub.continueWatching'
- - name: playQueueItemID
- description: The play queue item ID of the media item
- required: true
- in: query
- schema:
- type: number
- example: 1
- - name: playBackTime
- description: The playback time of the media item
- required: true
- in: query
- schema:
- type: number
- example: 2000
- - name: row
- description: The row of the media item
- required: true
- in: query
- schema:
- type: number
- example: 1
- responses:
- '200':
- description: The timeline for the media item
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: getTimeline
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
- $request = new Operations\GetTimelineRequest(
- ratingKey: 23409,
- key: '/library/metadata/23409',
- state: Operations\State::Playing,
- hasMDE: 1,
- time: 2000,
+ const result = await plexAPI.timeline.report({
+ key: "/foo",
+ ratingKey: "xyz",
+ state: ReportState.Playing,
+ playQueueItemID: "123",
+ time: 0,
duration: 10000,
- context: 'home:hub.continueWatching',
- playQueueItemID: 1,
- playBackTime: 2000,
- row: 1,
- );
+ continuing: BoolInt.One,
+ updated: 14200000,
+ offline: BoolInt.One,
+ timeToFirstFrame: 1000,
+ timeStalled: 1000,
+ bandwidth: 100,
+ bufferedTime: 100,
+ bufferedSize: 1024,
+ });
- $response = $sdk->video->getTimeline(
- request: $request
- );
-
- if ($response->statusCode === 200) {
- // handle response
+ console.log(result);
}
- - lang: ruby
- label: getTimeline
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetTimelineRequest.new(\n rating_key: 23409.0,\n key: \"/library/metadata/23409\",\n state: ::PlexRubySDK::Operations::State::PLAYING,\n has_mde: 1.0,\n time: 2000.0,\n duration: 10000.0,\n context: \"home:hub.continueWatching\",\n play_queue_item_id: 1.0,\n play_back_time: 2000.0,\n row: 1.0,\n)\n \nres = s.video.get_timeline(req)\n\nif res.status_code == 200\n # handle response\nend"
+
+ run();
+ /:/unscrobble:
+ put:
+ summary: Mark an item as unplayed
+ operationId: unscrobble
+ description: |-
+ Mark an item as unplayed. The client must provide either the `key` or `uri` query parameter
+ This API does respond to the GET verb but applications should use PUT
+ tags:
+ - Timeline
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: identifier
+ description: The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library`
+ in: query
+ required: true
+ schema:
+ type: string
+ - name: key
+ description: The key of the item to rate. This is the `ratingKey` found in metadata items
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: uri
+ description: The URI of the item to mark as played. See intro for description of the URIs
+ in: query
+ required: false
+ schema:
+ type: string
+ responses:
+ '200':
+ $ref: '#/components/responses/200'
+ '400':
+ description: Bad Request. Can occur when parameters are of the wrong type, or missing
+ content:
+ text/html: {}
+ '404':
+ description: Indicates that no library with the provide identifier can be found or no item can be found with the rating key
+ content:
+ text/html: {}
+ x-codeSamples:
- lang: go
- label: getTimeline
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{\n RatingKey: 23409,\n Key: \"/library/metadata/23409\",\n State: operations.StatePlaying,\n HasMDE: 1,\n Time: 2000,\n Duration: 10000,\n Context: \"home:hub.continueWatching\",\n PlayQueueItemID: 1,\n PlayBackTime: 2000,\n Row: 1,\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Timeline.Unscrobble(ctx, operations.UnscrobbleRequest{
+ Identifier: "",
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
+ }
+ }
- lang: java
- label: getTimeline
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetTimelineBadRequest;
- import dev.plexapi.plexapi.models.errors.GetTimelineUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetTimelineRequest;
- import dev.plexapi.plexapi.models.operations.GetTimelineResponse;
- import dev.plexapi.plexapi.models.operations.State;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.UnscrobbleRequest;
+ import dev.plexapi.sdk.models.operations.UnscrobbleResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetTimelineBadRequest, GetTimelineUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetTimelineRequest req = GetTimelineRequest.builder()
- .ratingKey(23409d)
- .key("/library/metadata/23409")
- .state(State.PLAYING)
- .hasMDE(1d)
- .time(2000d)
- .duration(10000d)
- .context("home:hub.continueWatching")
- .playQueueItemID(1d)
- .playBackTime(2000d)
- .row(1d)
+ UnscrobbleRequest req = UnscrobbleRequest.builder()
+ .identifier("")
.build();
- GetTimelineResponse res = sdk.video().getTimeline()
+ UnscrobbleResponse res = sdk.timeline().unscrobble()
.request(req)
.call();
@@ -1159,131 +1720,241 @@ paths:
}
}
- lang: typescript
- label: getTimeline
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { State } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.video.getTimeline({
- ratingKey: 23409,
- key: "/library/metadata/23409",
- state: State.Playing,
- hasMDE: 1,
- time: 2000,
- duration: 10000,
- context: "home:hub.continueWatching",
- playQueueItemID: 1,
- playBackTime: 2000,
- row: 1,
+ const result = await plexAPI.timeline.unscrobble({
+ identifier: "",
});
- // Handle the result
+ console.log(result);
+ }
+
+ run();
+ /:/websocket/notifications:
+ get:
+ summary: Connect to WebSocket
+ operationId: connectWebSocket
+ description: Connect to the web socket to get a stream of events
+ tags:
+ - Events
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: filter
+ description: |
+ By default, all events except logs are sent. A rich filtering mechanism is provided to allow clients to opt into or out of each event type using the `filters` parameter. For example:
+
+ - `filters=-log`: All event types except logs (the default).
+ - `filters=foo,bar`: Only the foo and bar event types.
+ - `filters=`: All events types.
+ - `filters=-foo,bar`: All event types except foo and bar.
+ in: query
+ schema:
+ type: array
+ items:
+ type: string
+ responses:
+ '200':
+ description: OK
+ content:
+ application/octet-stream:
+ schema:
+ format: binary
+ type: string
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Events.ConnectWebSocket(ctx, operations.ConnectWebSocketRequest{})
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.ResponseStream != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.ConnectWebSocketRequest;
+ import dev.plexapi.sdk.models.operations.ConnectWebSocketResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ ConnectWebSocketRequest req = ConnectWebSocketRequest.builder()
+ .build();
+
+ ConnectWebSocketResponse res = sdk.events().connectWebSocket()
+ .request(req)
+ .call();
+
+ if (res.responseStream().isPresent()) {
+ // handle response
+ }
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.events.connectWebSocket({});
+
console.log(result);
}
run();
/activities:
get:
+ summary: Get all activities
+ operationId: listActivities
+ description: List all activities on the server. Admins can see all activities but other users can only see their own
tags:
- Activities
- summary: Get Server Activities
- description: Get Server Activities
- operationId: getServerActivities
responses:
'200':
- description: The Server Activities
+ description: OK
content:
application/json:
schema:
- type: object
properties:
MediaContainer:
- type: object
- properties:
- size:
- type: number
- Activity:
- type: array
- items:
- type: object
- properties:
- uuid:
- type: string
- type:
- type: string
- cancellable:
- type: boolean
- userID:
- type: number
- title:
- type: string
- subtitle:
- type: string
- progress:
- type: number
- Context:
- type: object
+ allOf:
+ - properties:
+ Activity:
+ items:
properties:
- librarySectionID:
+ cancellable:
+ description: Indicates whether this activity can be cancelled
+ type: boolean
+ Context:
+ description: An object with additional values
+ additionalProperties: true
+ type: object
+ progress:
+ description: A progress percentage. A value of -1 means the progress is indeterminate
+ maximum: 100
+ minimum: -1
+ type: number
+ Response:
+ description: An object with the response to the async opperation
+ additionalProperties: true
+ type: object
+ subtitle:
+ description: A user-friendly sub-title for this activity
type: string
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
+ title:
+ description: A user-friendly title for this activity
+ type: string
+ type:
+ description: The type of activity
+ type: string
+ userID:
+ description: The user this activity belongs to
+ type: integer
+ uuid:
+ description: The ID of the activity
+ type: string
+ type: object
+ type: array
+ type: object
type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
x-codeSamples:
- lang: php
- label: getServerActivities
+ label: PlexPHP
source: |-
declare(strict_types=1);
@@ -1307,31 +1978,65 @@ paths:
// handle response
}
- lang: ruby
- label: getServerActivities
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.activities.get_server_activities()\n\nif ! res.object.nil?\n # handle response\nend"
+ label: PlexRuby
+ source: |-
+ require 'plex_ruby_sdk'
+
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
+
+ res = s.activities.get_server_activities()
+
+ if ! res.object.nil?
+ # handle response
+ end
- lang: go
- label: getServerActivities
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Activities.GetServerActivities(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Activities.ListActivities(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
- lang: java
- label: getServerActivities
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetServerActivitiesBadRequest;
- import dev.plexapi.plexapi.models.errors.GetServerActivitiesUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetServerActivitiesResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.ListActivitiesResponse;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetServerActivitiesBadRequest, GetServerActivitiesUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetServerActivitiesResponse res = sdk.activities().getServerActivities()
+ ListActivitiesResponse res = sdk.activities().listActivities()
.call();
if (res.object().isPresent()) {
@@ -1340,528 +2045,35 @@ paths:
}
}
- lang: typescript
- label: getServerActivities
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
+ const plexAPI = new PlexAPI();
async function run() {
- const result = await plexAPI.activities.getServerActivities();
+ const result = await plexAPI.activities.listActivities();
- // Handle the result
- console.log(result);
- }
-
- run();
- '/activities/{activityUUID}':
- delete:
- tags:
- - Activities
- summary: Cancel Server Activities
- description: Cancel Server Activities
- operationId: cancelServerActivities
- parameters:
- - name: activityUUID
- description: The UUID of the activity to cancel.
- in: path
- schema:
- type: string
- example: 25b71ed5-0f9d-461c-baa7-d404e9e10d3e
- required: true
- responses:
- '200':
- description: The Server Activity was canceled
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: cancelServerActivities
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->activities->cancelServerActivities(
- activityUUID: '25b71ed5-0f9d-461c-baa7-d404e9e10d3e'
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: cancelServerActivities
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.activities.cancel_server_activities(activity_uuid=\"25b71ed5-0f9d-461c-baa7-d404e9e10d3e\")\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: cancelServerActivities
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Activities.CancelServerActivities(ctx, \"25b71ed5-0f9d-461c-baa7-d404e9e10d3e\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: cancelServerActivities
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.CancelServerActivitiesBadRequest;
- import dev.plexapi.plexapi.models.errors.CancelServerActivitiesUnauthorized;
- import dev.plexapi.plexapi.models.operations.CancelServerActivitiesResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws CancelServerActivitiesBadRequest, CancelServerActivitiesUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities()
- .activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
- .call();
-
- // handle response
- }
- }
- - lang: typescript
- label: cancelServerActivities
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e");
-
- // Handle the result
console.log(result);
}
run();
/butler:
- get:
- tags:
- - Butler
- summary: Get Butler tasks
- description: Returns a list of butler tasks
- operationId: getButlerTasks
- responses:
- '200':
- description: All butler tasks
- content:
- application/json:
- schema:
- type: object
- properties:
- ButlerTasks:
- type: object
- properties:
- ButlerTask:
- type: array
- items:
- type: object
- properties:
- name:
- type: string
- example: BackupDatabase
- interval:
- type: number
- example: 3
- scheduleRandomized:
- type: boolean
- enabled:
- type: boolean
- title:
- type: string
- example: Backup Database
- description:
- type: string
- example: Create a backup copy of the server's database in the configured backup directory
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: getButlerTasks
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->butler->getButlerTasks(
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: getButlerTasks
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.get_butler_tasks()\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: getButlerTasks
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Butler.GetButlerTasks(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: getButlerTasks
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetButlerTasksBadRequest;
- import dev.plexapi.plexapi.models.errors.GetButlerTasksUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetButlerTasksResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetButlerTasksBadRequest, GetButlerTasksUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetButlerTasksResponse res = sdk.butler().getButlerTasks()
- .call();
-
- if (res.object().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: getButlerTasks
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.butler.getButlerTasks();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- post:
- tags:
- - Butler
- summary: Start all Butler tasks
- description: |
- This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
- 1. Any tasks not scheduled to run on the current day will be skipped.
- 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
- 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
- 4. If we are outside the configured window, the task will start immediately.
- operationId: startAllTasks
- responses:
- '200':
- description: All tasks were started
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: startAllTasks
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->butler->startAllTasks(
-
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: startAllTasks
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.start_all_tasks()\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: startAllTasks
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Butler.StartAllTasks(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: startAllTasks
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.StartAllTasksBadRequest;
- import dev.plexapi.plexapi.models.errors.StartAllTasksUnauthorized;
- import dev.plexapi.plexapi.models.operations.StartAllTasksResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws StartAllTasksBadRequest, StartAllTasksUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- StartAllTasksResponse res = sdk.butler().startAllTasks()
- .call();
-
- // handle response
- }
- }
- - lang: typescript
- label: startAllTasks
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.butler.startAllTasks();
-
- // Handle the result
- console.log(result);
- }
-
- run();
delete:
+ summary: Stop all Butler tasks
+ operationId: stopTasks
+ description: This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
tags:
- Butler
- summary: Stop all Butler tasks
- description: |
- This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
- operationId: stopAllTasks
+ security:
+ - token:
+ - admin
responses:
'200':
- description: All tasks were stopped
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ $ref: '#/components/responses/200'
x-codeSamples:
- lang: php
- label: stopAllTasks
+ label: PlexPHP
source: |-
declare(strict_types=1);
@@ -1885,1421 +2097,131 @@ paths:
// handle response
}
- lang: ruby
- label: stopAllTasks
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.stop_all_tasks()\n\nif res.status_code == 200\n # handle response\nend"
+ label: PlexRuby
+ source: |-
+ require 'plex_ruby_sdk'
+
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
+
+ res = s.butler.stop_all_tasks()
+
+ if res.status_code == 200
+ # handle response
+ end
- lang: go
- label: stopAllTasks
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Butler.StopAllTasks(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Butler.StopTasks(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
+ }
+ }
- lang: java
- label: stopAllTasks
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.StopAllTasksBadRequest;
- import dev.plexapi.plexapi.models.errors.StopAllTasksUnauthorized;
- import dev.plexapi.plexapi.models.operations.StopAllTasksResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.StopTasksResponse;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws StopAllTasksBadRequest, StopAllTasksUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- StopAllTasksResponse res = sdk.butler().stopAllTasks()
+ StopTasksResponse res = sdk.butler().stopTasks()
.call();
// handle response
}
}
- lang: typescript
- label: stopAllTasks
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.butler.stopAllTasks();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/butler/{taskName}':
- post:
- tags:
- - Butler
- summary: Start a single Butler task
- description: |
- This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
- 1. Any tasks not scheduled to run on the current day will be skipped.
- 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
- 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
- 4. If we are outside the configured window, the task will start immediately.
- operationId: startTask
- parameters:
- - name: taskName
- description: the name of the task to be started.
- in: path
- schema:
- type: string
- enum:
- - BackupDatabase
- - BuildGracenoteCollections
- - CheckForUpdates
- - CleanOldBundles
- - CleanOldCacheFiles
- - DeepMediaAnalysis
- - GenerateAutoTags
- - GenerateChapterThumbs
- - GenerateMediaIndexFiles
- - OptimizeDatabase
- - RefreshLibraries
- - RefreshLocalMedia
- - RefreshPeriodicMetadata
- - UpgradeMediaAnalysis
- required: true
- responses:
- '200':
- description: The task was started successfully
- '202':
- description: The task was already running.
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: startTask
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->butler->startTask(
- taskName: Operations\TaskName::CleanOldBundles
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: startTask
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.start_task(task_name=::PlexRubySDK::Operations::TaskName::CLEAN_OLD_BUNDLES)\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: startTask
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Butler.StartTask(ctx, operations.TaskNameCleanOldBundles)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: startTask
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.StartTaskBadRequest;
- import dev.plexapi.plexapi.models.errors.StartTaskUnauthorized;
- import dev.plexapi.plexapi.models.operations.StartTaskResponse;
- import dev.plexapi.plexapi.models.operations.TaskName;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws StartTaskBadRequest, StartTaskUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- StartTaskResponse res = sdk.butler().startTask()
- .taskName(TaskName.CLEAN_OLD_BUNDLES)
- .call();
-
- // handle response
- }
- }
- - lang: typescript
- label: startTask
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
- import { TaskName } from "@lukehagar/plexjs/sdk/models/operations";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles);
-
- // Handle the result
- console.log(result);
- }
-
- run();
- delete:
- tags:
- - Butler
- summary: Stop a single Butler task
- description: |
- This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
- operationId: stopTask
- parameters:
- - name: taskName
- description: The name of the task to be started.
- in: path
- schema:
- type: string
- enum:
- - BackupDatabase
- - BuildGracenoteCollections
- - CheckForUpdates
- - CleanOldBundles
- - CleanOldCacheFiles
- - DeepMediaAnalysis
- - GenerateAutoTags
- - GenerateChapterThumbs
- - GenerateMediaIndexFiles
- - OptimizeDatabase
- - RefreshLibraries
- - RefreshLocalMedia
- - RefreshPeriodicMetadata
- - UpgradeMediaAnalysis
- required: true
- responses:
- '200':
- description: The task was stopped
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- '404':
- description: The task was not running
- x-codeSamples:
- - lang: php
- label: stopTask
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->butler->stopTask(
- taskName: Operations\PathParamTaskName::BackupDatabase
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: stopTask
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.stop_task(task_name=::PlexRubySDK::Operations::PathParamTaskName::BACKUP_DATABASE)\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: stopTask
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Butler.StopTask(ctx, operations.PathParamTaskNameBackupDatabase)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: stopTask
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.StopTaskBadRequest;
- import dev.plexapi.plexapi.models.errors.StopTaskUnauthorized;
- import dev.plexapi.plexapi.models.operations.PathParamTaskName;
- import dev.plexapi.plexapi.models.operations.StopTaskResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws StopTaskBadRequest, StopTaskUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- StopTaskResponse res = sdk.butler().stopTask()
- .taskName(PathParamTaskName.BACKUP_DATABASE)
- .call();
-
- // handle response
- }
- }
- - lang: typescript
- label: stopTask
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
- import { PathParamTaskName } from "@lukehagar/plexjs/sdk/models/operations";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase);
-
- // Handle the result
- console.log(result);
- }
-
- run();
- /clients:
- get:
- tags:
- - Server
- summary: Get Available Clients
- description: Get Available Clients
- operationId: getAvailableClients
- responses:
- '200':
- description: Available Clients
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- type: object
- properties:
- size:
- type: number
- example: 1
- Server:
- type: array
- items:
- type: object
- properties:
- name:
- type: string
- example: iPad
- host:
- type: string
- example: 10.10.10.102
- address:
- type: string
- example: 10.10.10.102
- port:
- type: number
- example: 32500
- machineIdentifier:
- type: string
- example: A2E901F8-E016-43A7-ADFB-EF8CA8A4AC05
- version:
- type: string
- example: '8.17'
- protocol:
- type: string
- example: plex
- product:
- type: string
- example: Plex for iOS
- deviceClass:
- type: string
- example: tablet
- protocolVersion:
- type: number
- example: 2
- protocolCapabilities:
- type: string
- example: 'playback,playqueues,timeline,provider-playback'
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: getAvailableClients
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->server->getAvailableClients(
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: getAvailableClients
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_available_clients()\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: getAvailableClients
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Server.GetAvailableClients(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: getAvailableClients
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetAvailableClientsBadRequest;
- import dev.plexapi.plexapi.models.errors.GetAvailableClientsUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetAvailableClientsResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetAvailableClientsBadRequest, GetAvailableClientsUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetAvailableClientsResponse res = sdk.server().getAvailableClients()
- .call();
-
- if (res.object().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: getAvailableClients
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.server.getAvailableClients();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- /devices:
- get:
- tags:
- - Server
- summary: Get Devices
- description: Get Devices
- operationId: getDevices
- responses:
- '200':
- description: Devices
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- type: object
- properties:
- size:
- type: number
- example: 151
- identifier:
- type: string
- example: com.plexapp.system.devices
- Device:
- type: array
- items:
- type: object
- properties:
- id:
- type: number
- example: 1
- name:
- type: string
- example: iPhone
- platform:
- type: string
- example: iOS
- clientIdentifier:
- type: string
- createdAt:
- type: number
- example: 1654131230
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: getDevices
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->server->getDevices(
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: getDevices
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_devices()\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: getDevices
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Server.GetDevices(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: getDevices
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetDevicesBadRequest;
- import dev.plexapi.plexapi.models.errors.GetDevicesUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetDevicesResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetDevicesBadRequest, GetDevicesUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetDevicesResponse res = sdk.server().getDevices()
- .call();
-
- if (res.object().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: getDevices
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.server.getDevices();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- /companions:
- get:
- servers:
- - url: 'https://plex.tv/api/v2'
- tags:
- - Plex
- summary: Get Companions Data
- description: Get Companions Data
- operationId: getCompanionsData
- responses:
- '200':
- description: Companions Data
- content:
- application/json:
- schema:
- type: array
- items:
- type: object
- required:
- - identifier
- - baseURL
- - title
- - linkURL
- - provides
- - token
- properties:
- identifier:
- type: string
- example: tv.plex.sonos
- baseURL:
- type: string
- example: 'https://sonos.plex.tv'
- format: uri
- title:
- type: string
- example: Sonos
- linkURL:
- type: string
- example: 'https://sonos.plex.tv/link'
- provides:
- type: string
- example: 'client,player'
- token:
- type: string
- description: The plex authtoken used to identify with
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: getCompanionsData
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->plex->getCompanionsData(
-
- );
-
- if ($response->responseBodies !== null) {
- // handle response
- }
- - lang: ruby
- label: getCompanionsData
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_companions_data()\n\nif ! res.response_bodies.nil?\n # handle response\nend"
- - lang: go
- label: getCompanionsData
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Plex.GetCompanionsData(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.ResponseBodies != nil {\n // handle response\n }\n}"
- - lang: java
- label: getCompanionsData
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetCompanionsDataBadRequest;
- import dev.plexapi.plexapi.models.errors.GetCompanionsDataUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetCompanionsDataResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
- .call();
-
- if (res.responseBodies().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: getCompanionsData
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.plex.getCompanionsData();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- /friends:
- get:
- servers:
- - url: 'https://plex.tv/api/v2'
- tags:
- - Plex
- summary: Get list of friends of the user logged in
- description: Get friends of provided auth token.
- operationId: getUserFriends
- responses:
- '200':
- description: Friends Data
- content:
- application/json:
- schema:
- type: array
- items:
- title: Friend
- type: object
- examples:
- - email: username@email.com
- friendlyName: exampleUser
- home: true
- id: 0
- restricted: false
- sharedServers: []
- sharedSources: []
- status: accepted
- thumb: 'https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578'
- title: username123
- username: username123
- uuid: 7d1916e0d8f6e76b
- required:
- - email
- - friendlyName
- - home
- - id
- - restricted
- - sharedServers
- - sharedSources
- - status
- - thumb
- - title
- - username
- - uuid
- properties:
- email:
- type: string
- format: email
- example: username@email.com
- description: The account email address
- friendlyName:
- examples:
- - exampleUser
- - null
- type:
- - string
- - 'null'
- description: The account full name
- home:
- type: boolean
- description: If the account is a Plex Home user
- id:
- type: integer
- format: int32
- description: The Plex account ID
- restricted:
- type: boolean
- default: false
- description: If the account is a Plex Home managed user
- sharedServers:
- type: array
- items:
- type: object
- sharedSources:
- type: array
- items:
- type: object
- status:
- examples:
- - accepted
- enum:
- - accepted
- description: Current friend request status
- thumb:
- type: string
- example: 'https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578'
- format: uri
- description: URL of the account thumbnail
- title:
- type: string
- example: username123
- description: The title of the account (username or friendly name)
- username:
- type: string
- example: username123
- description: The account username
- uuid:
- type: string
- example: 7d1916e0d8f6e76b
- description: The account Universally Unique Identifier (UUID)
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: getUserFriends
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->plex->getUserFriends(
-
- );
-
- if ($response->friends !== null) {
- // handle response
- }
- - lang: ruby
- label: getUserFriends
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_user_friends()\n\nif ! res.friends.nil?\n # handle response\nend"
- - lang: go
- label: getUserFriends
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Plex.GetUserFriends(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Friends != nil {\n // handle response\n }\n}"
- - lang: java
- label: getUserFriends
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetUserFriendsBadRequest;
- import dev.plexapi.plexapi.models.errors.GetUserFriendsUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetUserFriendsResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetUserFriendsBadRequest, GetUserFriendsUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetUserFriendsResponse res = sdk.plex().getUserFriends()
- .call();
-
- if (res.friends().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: getUserFriends
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.plex.getUserFriends();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- /geoip:
- get:
- servers:
- - url: 'https://plex.tv/api/v2'
- security: []
- tags:
- - Plex
- summary: Get Geo Data
- description: Returns the geolocation and locale data of the caller
- operationId: getGeoData
- responses:
- '200':
- description: Gets the geo location data of the user
- content:
- application/json:
- schema:
- title: GeoData
- type: object
- description: Geo location data
- examples:
- - code: VI
- continent_code: NA
- country: United States Virgin Islands
- city: Amsterdam
- european_union_member: true
- time_zone: America/St_Thomas
- postal_code: 802
- in_privacy_restricted_country: true
- in_privacy_restricted_region: true
- subdivisions: Saint Thomas
- coordinates: '18.3381, -64.8941'
- required:
- - code
- - continent_code
- - country
- - city
- - european_union_member
- - time_zone
- - postal_code
- - in_privacy_restricted_country
- - in_privacy_restricted_region
- - subdivisions
- - coordinates
- properties:
- code:
- type: string
- description: The ISO 3166-1 alpha-2 code of the country.
- example: VI
- continent_code:
- type: string
- description: The continent code where the country is located.
- example: NA
- country:
- type: string
- description: The official name of the country.
- example: United States Virgin Islands
- city:
- type: string
- description: The name of the city.
- example: Amsterdam
- european_union_member:
- type: boolean
- description: Indicates if the country is a member of the European Union.
- example: true
- default: false
- time_zone:
- type: string
- description: The time zone of the country.
- example: America/St_Thomas
- postal_code:
- type: string
- description: The postal code of the location.
- example: '802'
- in_privacy_restricted_country:
- type: boolean
- description: Indicates if the country has privacy restrictions.
- example: true
- default: false
- in_privacy_restricted_region:
- type: boolean
- description: Indicates if the region has privacy restrictions.
- example: true
- default: false
- subdivisions:
- type: string
- description: The name of the primary administrative subdivision.
- example: Saint Thomas
- coordinates:
- type: string
- description: 'The geographical coordinates (latitude, longitude) of the location.'
- example: '18.3381, -64.8941'
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: getGeoData
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()->build();
-
-
-
- $response = $sdk->plex->getGeoData(
-
- );
-
- if ($response->geoData !== null) {
- // handle response
- }
- - lang: ruby
- label: getGeoData
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\n\n \nres = s.plex.get_geo_data()\n\nif ! res.geo_data.nil?\n # handle response\nend"
- - lang: go
- label: getGeoData
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Plex.GetGeoData(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.GeoData != nil {\n // handle response\n }\n}"
- - lang: java
- label: getGeoData
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetGeoDataBadRequest;
- import dev.plexapi.plexapi.models.errors.GetGeoDataUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetGeoDataResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .build();
-
- GetGeoDataResponse res = sdk.plex().getGeoData()
- .call();
-
- if (res.geoData().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: getGeoData
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI();
async function run() {
- const result = await plexAPI.plex.getGeoData();
+ const result = await plexAPI.butler.stopTasks();
- // Handle the result
console.log(result);
}
run();
- /home:
get:
+ summary: Get all Butler tasks
+ operationId: getTasks
+ description: |
+ Get the list of butler tasks and their scheduling
tags:
- - Plex
- summary: Get Plex Home Data
- description: 'Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.'
- operationId: getHomeData
+ - Butler
+ security:
+ - token:
+ - admin
responses:
'200':
- description: Home Data
+ description: Butler tasks
content:
application/json:
schema:
- type: object
properties:
- id:
- type: number
- example: 1841489
- name:
- type: string
- example: Blindkitty38's home
- guestUserID:
- type: number
- example: 58815432
- guestUserUUID:
- type: string
- example: f3df4e01bfca0787
- guestEnabled:
- type: boolean
- subscription:
- type: boolean
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
+ ButlerTasks:
+ properties:
+ ButlerTask:
+ items:
+ properties:
+ description:
+ description: A user-friendly description of the task
+ type: string
+ enabled:
+ description: Whether this task is enabled or not
+ type: boolean
+ interval:
+ description: The interval (in days) of when this task is run. A value of 1 is run every day, 7 is every week, etc.
+ type: integer
+ name:
+ description: The name of the task
+ type: string
+ scheduleRandomized:
+ description: Indicates whether the timing of the task is randomized within the butler interval
+ type: boolean
+ title:
+ description: A user-friendly title of the task
+ type: string
+ type: object
+ type: array
+ type: object
type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
x-codeSamples:
- lang: php
- label: getHomeData
+ label: PlexPHP
source: |-
declare(strict_types=1);
@@ -3315,7 +2237,7 @@ paths:
- $response = $sdk->plex->getHomeData(
+ $response = $sdk->butler->getButlerTasks(
);
@@ -3323,31 +2245,65 @@ paths:
// handle response
}
- lang: ruby
- label: getHomeData
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_home_data()\n\nif ! res.object.nil?\n # handle response\nend"
+ label: PlexRuby
+ source: |-
+ require 'plex_ruby_sdk'
+
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
+
+ res = s.butler.get_butler_tasks()
+
+ if ! res.object.nil?
+ # handle response
+ end
- lang: go
- label: getHomeData
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Plex.GetHomeData(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Butler.GetTasks(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
- lang: java
- label: getHomeData
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetHomeDataBadRequest;
- import dev.plexapi.plexapi.models.errors.GetHomeDataUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetHomeDataResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetTasksResponse;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetHomeDataBadRequest, GetHomeDataUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetHomeDataResponse res = sdk.plex().getHomeData()
+ GetTasksResponse res = sdk.butler().getTasks()
.call();
if (res.object().isPresent()) {
@@ -3356,224 +2312,316 @@ paths:
}
}
- lang: typescript
- label: getHomeData
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
+ const plexAPI = new PlexAPI();
async function run() {
- const result = await plexAPI.plex.getHomeData();
+ const result = await plexAPI.butler.getTasks();
- // Handle the result
console.log(result);
}
run();
- /hubs:
- get:
+ post:
+ summary: Start all Butler tasks
+ operationId: startTasks
+ description: |
+ This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
+
+ 1. Any tasks not scheduled to run on the current day will be skipped.
+ 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
+ 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
+ 4. If we are outside the configured window, the task will start immediately.
tags:
- - Hubs
- summary: Get Global Hubs
- description: Get Global Hubs filtered by the parameters provided.
- operationId: getGlobalHubs
- parameters:
- - name: count
- description: The number of items to return with each hub.
- in: query
- schema:
- type: number
- required: false
- - name: onlyTransient
- description: 'Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).'
- in: query
- schema:
- type: integer
- enum:
- - 0
- - 1
- required: false
+ - Butler
+ security:
+ - token:
+ - admin
responses:
'200':
- description: returns global hubs
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- type: object
- properties:
- size:
- type: integer
- format: int32
- example: 8
- allowSync:
- type: boolean
- example: true
- identifier:
- type: string
- example: com.plexapp.plugins.library
- Hub:
- type: array
- items:
- type: object
- properties:
- hubKey:
- type: string
- example: '/library/metadata/50768,65523,58188,57341,57302,57070'
- key:
- type: string
- example: '/playlists/all?type=15&sort=lastViewedAt:desc&playlistType=video,audio'
- title:
- type: string
- example: Recent Playlists
- type:
- type: string
- example: playlist
- hubIdentifier:
- type: string
- example: home.playlists
- context:
- type: string
- example: hub.home.playlists
- size:
- type: integer
- format: int32
- example: 6
- more:
- type: boolean
- example: true
- style:
- type: string
- example: shelf
- promoted:
- type: boolean
- example: true
- Metadata:
- type: array
- items:
- type: object
- properties:
- ratingKey:
- type: string
- example: '57070'
- key:
- type: string
- example: /playlists/57070/items
- guid:
- type: string
- example: 'com.plexapp.agents.none://9fee6c5b-3143-4923-813e-57bd0190056c'
- type:
- type: string
- example: playlist
- title:
- type: string
- example: November Movie Day
- titleSort:
- type: string
- example: Tracks
- summary:
- type: string
- example: ''
- smart:
- type: boolean
- example: false
- playlistType:
- type: string
- example: video
- composite:
- type: string
- example: /playlists/57070/composite/1668787730
- icon:
- type: string
- example: 'playlist://image.smart'
- viewCount:
- type: integer
- format: int32
- example: 2
- lastViewedAt:
- type: integer
- format: int32
- example: 1668787732
- duration:
- type: integer
- format: int32
- example: 16873000
- leafCount:
- type: integer
- format: int32
- example: 3
- addedAt:
- type: integer
- format: int32
- example: 1668779618
- updatedAt:
- type: integer
- format: int32
- example: 1668787730
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ $ref: '#/components/responses/200'
x-codeSamples:
- lang: php
- label: getGlobalHubs
+ label: PlexPHP
+ source: |-
+ declare(strict_types=1);
+
+ require 'vendor/autoload.php';
+
+ use LukeHagar\Plex_API;
+
+ $sdk = Plex_API\PlexAPI::builder()
+ ->setSecurity(
+ ''
+ )
+ ->build();
+
+
+
+ $response = $sdk->butler->startAllTasks(
+
+ );
+
+ if ($response->statusCode === 200) {
+ // handle response
+ }
+ - lang: ruby
+ label: PlexRuby
+ source: |-
+ require 'plex_ruby_sdk'
+
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
+
+ res = s.butler.start_all_tasks()
+
+ if res.status_code == 200
+ # handle response
+ end
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Butler.StartTasks(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.StartTasksResponse;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ StartTasksResponse res = sdk.butler().startTasks()
+ .call();
+
+ // handle response
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+
+ const plexAPI = new PlexAPI();
+
+ async function run() {
+ const result = await plexAPI.butler.startTasks();
+
+ console.log(result);
+ }
+
+ run();
+ /downloadQueue:
+ post:
+ summary: Create download queue
+ operationId: createDownloadQueue
+ description: |
+ Available: 0.2.0
+
+ Creates a download queue for this client if one doesn't exist, or returns the existing queue for this client and user.
+ tags:
+ - Download Queue
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ MediaContainer:
+ allOf:
+ - $ref: '#/components/schemas/MediaContainer'
+ - properties:
+ DownloadQueue:
+ items:
+ properties:
+ id:
+ type: integer
+ itemCount:
+ type: integer
+ status:
+ description: |
+ The state of this queue
+ - deciding: At least one item is still being decided
+ - waiting: At least one item is waiting for transcode and none are currently transcoding
+ - processing: At least one item is being transcoded
+ - done: All items are available (or potentially expired)
+ - error: At least one item has encountered an error
+ enum:
+ - deciding
+ - waiting
+ - processing
+ - done
+ - error
+ type: string
+ type: object
+ type: array
+ type: object
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.DownloadQueue.CreateDownloadQueue(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.CreateDownloadQueueResponse;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ CreateDownloadQueueResponse res = sdk.downloadQueue().createDownloadQueue()
+ .call();
+
+ if (res.object().isPresent()) {
+ // handle response
+ }
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+
+ const plexAPI = new PlexAPI();
+
+ async function run() {
+ const result = await plexAPI.downloadQueue.createDownloadQueue();
+
+ console.log(result);
+ }
+
+ run();
+ /hubs:
+ get:
+ summary: Get global hubs
+ operationId: getAllHubs
+ description: Get the global hubs in this PMS
+ tags:
+ - Hubs
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - $ref: '#/components/parameters/count'
+ - name: onlyTransient
+ description: Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added)
+ in: query
+ schema:
+ $ref: "#/components/schemas/BoolInt"
+ - name: identifier
+ description: If provided, limit to only specified hubs
+ in: query
+ schema:
+ type: array
+ items:
+ type: string
+ responses:
+ '200':
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ $ref: '#/components/headers/X-Plex-Container-Start'
+ X-Plex-Container-Total-Size:
+ $ref: '#/components/headers/X-Plex-Container-Total-Size'
+ content:
+ application/json:
+ schema:
+ properties:
+ MediaContainer:
+ allOf:
+ - $ref: '#/components/schemas/MediaContainer'
+ - properties:
+ Hub:
+ items:
+ $ref: '#/components/schemas/Hub'
+ type: array
+ type: object
+ type: object
+ x-codeSamples:
+ - lang: php
+ label: PlexPHP
source: |-
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
@@ -3584,8 +2632,6 @@ paths:
$response = $sdk->hubs->getGlobalHubs(
- count: 1262.49,
- onlyTransient: Operations\OnlyTransient::One
);
@@ -3593,1134 +2639,72 @@ paths:
// handle response
}
- lang: ruby
- label: getGlobalHubs
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.hubs.get_global_hubs(count=1262.49, only_transient=::PlexRubySDK::Operations::OnlyTransient::ONE)\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: getGlobalHubs
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Hubs.GetGlobalHubs(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: getGlobalHubs
+ label: PlexRuby
source: |-
- package hello.world;
+ require 'plex_ruby_sdk'
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetGlobalHubsBadRequest;
- import dev.plexapi.plexapi.models.errors.GetGlobalHubsUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetGlobalHubsResponse;
- import dev.plexapi.plexapi.models.operations.OnlyTransient;
- import java.lang.Exception;
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
- public class Application {
+ res = s.hubs.get_global_hubs(count=1262.49, only_transient=Models::Operations::OnlyTransient::ONE)
- public static void main(String[] args) throws GetGlobalHubsBadRequest, GetGlobalHubsUnauthorized, Exception {
+ if ! res.object.nil?
+ # handle response
+ end
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
- GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
- .count(1262.49d)
- .onlyTransient(OnlyTransient.ONE)
- .call();
+ func main() {
+ ctx := context.Background()
- if (res.object().isPresent()) {
- // handle response
- }
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Hubs.GetAllHubs(ctx, operations.GetAllHubsRequest{
+ OnlyTransient: components.BoolIntOne.ToPointer(),
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
}
}
- - lang: typescript
- label: getGlobalHubs
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.hubs.getGlobalHubs();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- /hubs/home/recentlyAdded:
- get:
- tags:
- - Hubs
- summary: Get Recently Added
- description: |
- This endpoint will return the recently added content.
- operationId: get-recently-added
- parameters:
- - name: contentDirectoryID
- in: query
- required: true
- schema:
- type: integer
- description: The content directory ID.
- - name: pinnedContentDirectoryID
- in: query
- required: false
- schema:
- type: string
- description: Comma-separated list of pinned content directory IDs.
- - name: sectionID
- in: query
- required: false
- description: The library section ID for filtering content.
- schema:
- type: integer
- example: 2
- - name: type
- in: query
- description: |
- The type of media to retrieve or filter by.
- 1 = movie
- 2 = show
- 3 = season
- 4 = episode
- E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
- schema:
- type: integer
- enum:
- - 1
- - 2
- - 3
- - 4
- - 8
- - 9
- - 10
- example: 2
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - AUDIO
- - ALBUM
- - TRACK
- required: true
- - name: includeMeta
- in: query
- description: |
- Adds the Meta object to the response
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: X-Plex-Container-Start
- in: query
- description: |
- The index of the first item to return. If not specified, the first item will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 0
- schema:
- type: integer
- format: int32
- default: 0
- example: 0
- required: false
- - name: X-Plex-Container-Size
- in: query
- description: |
- The number of items to return. If not specified, all items will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 50
- schema:
- type: integer
- format: int32
- default: 50
- example: 50
- required: false
- responses:
- '200':
- description: A successful response with recently added content.
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- allOf:
- - type: object
- required:
- - size
- properties:
- size:
- type: integer
- example: 50
- offset:
- type: integer
- format: int32
- totalSize:
- type: integer
- format: int32
- identifier:
- type: string
- example: com.plexapp.plugins.library
- allowSync:
- type: boolean
- example: false
- - type: object
- properties:
- Meta:
- type: object
- description: |
- The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
- properties:
- Type:
- type: array
- items:
- type: object
- required:
- - key
- - type
- - title
- - active
- properties:
- key:
- type: string
- example: /library/sections/2/all?type=2
- type:
- type: string
- example: filter
- subtype:
- type: string
- example: clip
- title:
- type: string
- example: TV Shows
- active:
- type: boolean
- example: false
- Filter:
- type: array
- items:
- type: object
- required:
- - filter
- - filterType
- - key
- - title
- - type
- properties:
- filter:
- type: string
- example: genre
- filterType:
- type: string
- example: string
- key:
- type: string
- example: /library/sections/2/genre?type=2
- title:
- type: string
- example: Genre
- type:
- type: string
- example: filter
- advanced:
- type: boolean
- example: true
- Sort:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - defaultDirection
- properties:
- default:
- type: string
- example: asc
- active:
- type: boolean
- example: false
- activeDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- defaultDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- descKey:
- type: string
- example: 'titleSort:desc'
- firstCharacterKey:
- type: string
- example: /library/sections/2/firstCharacter
- key:
- type: string
- example: titleSort
- title:
- type: string
- example: Title
- Field:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - type
- properties:
- key:
- type: string
- example: show.title
- title:
- type: string
- example: Show Title
- type:
- type: string
- example: string
- subType:
- type: string
- example: rating
- FieldType:
- type: array
- items:
- type: object
- required:
- - type
- - Operator
- properties:
- type:
- type: string
- example: tag
- Operator:
- type: array
- items:
- type: object
- required:
- - key
- - title
- properties:
- key:
- type: string
- example: '='
- title:
- type: string
- example: is
- Metadata:
- type: array
- items:
- type: object
- required:
- - ratingKey
- - key
- - guid
- - title
- - type
- - addedAt
- - summary
- properties:
- ratingKey:
- type: string
- example: '58683'
- description: |
- The rating key (Media ID) of this media item.
- Note: This is always an integer, but is represented as a string in the API.
- key:
- type: string
- example: /library/metadata/58683
- guid:
- type: string
- example: 'plex://movie/5d7768ba96b655001fdc0408'
- studio:
- type: string
- example: 20th Century Studios
- skipChildren:
- type: boolean
- example: false
- librarySectionID:
- type: integer
- examples:
- - 1
- librarySectionTitle:
- type: string
- example: Movies
- librarySectionKey:
- type: string
- example: /library/sections/1
- type:
- type: string
- enum:
- - movie
- - show
- - season
- - episode
- - artist
- - album
- example: movie
- description: |
- The type of media content
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - ARTIST
- - ALBUM
- title:
- type: string
- example: 'Avatar: The Way of Water'
- slug:
- type: string
- example: 4-for-texas
- contentRating:
- type: string
- example: PG-13
- summary:
- type: string
- example: 'Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na''vi race to protect their home.'
- rating:
- type: number
- example: 7.6
- audienceRating:
- type: number
- example: 9.2
- year:
- type: integer
- format: int32
- example: 2022
- seasonCount:
- type: integer
- format: int32
- example: 2022
- tagline:
- type: string
- example: Return to Pandora.
- flattenSeasons:
- type: string
- description: 'Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).'
- enum:
- - '-1'
- - '0'
- - '1'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - HIDE
- - SHOW
- example: '1'
- episodeSort:
- type: string
- description: 'Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).'
- enum:
- - '-1'
- - '0'
- - '1'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - OLDEST_FIRST
- - NEWEST_FIRST
- example: '0'
- enableCreditsMarkerGeneration:
- type: string
- description: 'Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).'
- enum:
- - '-1'
- - '0'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - DISABLED
- example: '-1'
- showOrdering:
- type: string
- description: |
- Setting that indicates the episode ordering for the show.
- None = Library default,
- tmdbAiring = The Movie Database (Aired),
- aired = TheTVDB (Aired),
- dvd = TheTVDB (DVD),
- absolute = TheTVDB (Absolute)).
- enum:
- - None
- - tmdbAiring
- - aired
- - dvd
- - absolute
- x-speakeasy-enums:
- - NONE
- - TMDB_AIRING
- - TVDB_AIRED
- - TVDB_DVD
- - TVDB_ABSOLUTE
- example: absolute
- thumb:
- type: string
- example: /library/metadata/58683/thumb/1703239236
- art:
- type: string
- example: /library/metadata/58683/art/1703239236
- banner:
- type: string
- example: /library/metadata/58683/banner/1703239236
- duration:
- type: integer
- format: int32
- example: 11558112
- originallyAvailableAt:
- type: string
- format: date
- example: 2022-12-14T00:00:00.000Z
- addedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- updatedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- audienceRatingImage:
- type: string
- example: 'rottentomatoes://image.rating.upright'
- chapterSource:
- type: string
- example: media
- primaryExtraKey:
- type: string
- example: /library/metadata/58684
- ratingImage:
- type: string
- example: 'rottentomatoes://image.rating.ripe'
- grandparentRatingKey:
- type: string
- example: '66'
- grandparentGuid:
- type: string
- example: 'plex://show/5d9c081b170e24001f2a7be4'
- grandparentKey:
- type: string
- example: /library/metadata/66
- grandparentTitle:
- type: string
- example: Caprica
- grandparentThumb:
- type: string
- example: /library/metadata/66/thumb/1705716261
- parentSlug:
- type: string
- example: alice-in-borderland-2020
- grandparentSlug:
- type: string
- example: alice-in-borderland-2020
- grandparentArt:
- type: string
- example: /library/metadata/66/art/1705716261
- grandparentTheme:
- type: string
- example: /library/metadata/66/theme/1705716261
- Media:
- description: |
- The Media object is only included when type query is `4` or higher.
- type: array
- items:
- type: object
- required:
- - id
- - container
- - Part
- properties:
- id:
- type: integer
- format: int32
- example: 119534
- duration:
- type: integer
- format: int32
- example: 11558112
- bitrate:
- type: integer
- format: int32
- example: 25025
- width:
- type: integer
- format: int32
- example: 3840
- height:
- type: integer
- format: int32
- example: 2072
- aspectRatio:
- type: number
- example: 1.85
- audioProfile:
- type: string
- example: dts
- audioChannels:
- type: integer
- format: int32
- example: 6
- audioCodec:
- type: string
- example: eac3
- videoCodec:
- type: string
- example: hevc
- videoResolution:
- type: string
- example: 4k
- container:
- type: string
- example: mkv
- videoFrameRate:
- type: string
- example: 24p
- videoProfile:
- type: string
- example: main 10
- hasVoiceActivity:
- type: boolean
- example: false
- optimizedForStreaming:
- allOf:
- - type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- has64bitOffsets:
- type: boolean
- example: false
- Part:
- type: array
- items:
- type: object
- required:
- - id
- - key
- - file
- - size
- - container
- properties:
- id:
- type: integer
- format: int32
- example: 119542
- key:
- type: string
- example: /library/parts/119542/1680457526/file.mkv
- duration:
- type: integer
- format: int32
- example: 11558112
- file:
- type: string
- example: /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv
- size:
- type: integer
- format: int64
- example: 36158371307
- container:
- type: string
- description: |
- The container format of the media file.
- example: mkv
- audioProfile:
- type: string
- example: dts
- has64bitOffsets:
- type: boolean
- example: false
- optimizedForStreaming:
- type: boolean
- example: false
- videoProfile:
- type: string
- example: main 10
- indexes:
- type: string
- example: sd
- hasThumbnail:
- type: string
- enum:
- - '0'
- - '1'
- example: '1'
- default: '0'
- x-speakeasy-enums:
- - false
- - true
- Stream:
- type: array
- items:
- type: object
- required:
- - id
- - streamType
- - codec
- - index
- properties:
- id:
- type: integer
- example: 272796
- streamType:
- type: integer
- description: 'Type of stream (1 = video, 2 = audio, 3 = subtitle)'
- example: 1
- default:
- type: boolean
- description: Indicates if this is the default stream
- example: true
- selected:
- type: boolean
- description: Indicates if the stream is selected
- example: true
- codec:
- type: string
- description: Codec used by the stream
- example: h264
- index:
- type: integer
- description: The index of the stream
- example: 0
- bitrate:
- type: integer
- description: The bitrate of the stream in kbps
- example: 6273
- colorPrimaries:
- type: string
- description: The color primaries of the video stream
- example: bt709
- colorRange:
- type: string
- description: The color range of the video stream
- example: tv
- colorSpace:
- type: string
- description: The color space of the video stream
- example: bt709
- colorTrc:
- type: string
- description: The transfer characteristics (TRC) of the video stream
- example: bt709
- bitDepth:
- type: integer
- description: The bit depth of the video stream
- example: 8
- chromaLocation:
- type: string
- description: The chroma location of the video stream
- example: left
- streamIdentifier:
- type: string
- description: The identifier of the video stream
- example: '2'
- chromaSubsampling:
- type: string
- description: The chroma subsampling format
- example: '4:2:0'
- codedHeight:
- type: integer
- description: The coded height of the video stream
- example: 1088
- codedWidth:
- type: integer
- description: The coded width of the video stream
- example: 1920
- frameRate:
- type: number
- description: The frame rate of the video stream
- example: 29.97
- hasScalingMatrix:
- type: boolean
- description: Indicates if the stream has a scaling matrix
- example: false
- hearingImpaired:
- type: boolean
- example: false
- closedCaptions:
- type: boolean
- example: false
- embeddedInVideo:
- type: string
- example: '1'
- height:
- type: integer
- description: The height of the video stream
- example: 1080
- level:
- type: integer
- description: The level of the video codec
- example: 40
- profile:
- type: string
- description: The profile of the video codec
- example: main
- refFrames:
- type: integer
- description: Number of reference frames
- example: 4
- scanType:
- type: string
- description: The scan type (progressive or interlaced)
- example: progressive
- width:
- type: integer
- description: The width of the video stream
- example: 1920
- displayTitle:
- type: string
- description: Display title of the stream
- example: 1080p (H.264)
- extendedDisplayTitle:
- type: string
- description: Extended display title of the stream
- example: 1080p (H.264)
- channels:
- type: integer
- description: Number of audio channels (for audio streams)
- example: 2
- language:
- type: string
- description: The language of the stream (for audio/subtitle streams)
- example: English
- languageTag:
- type: string
- description: Language tag of the stream
- example: en
- languageCode:
- type: string
- description: Language code of the stream
- example: eng
- audioChannelLayout:
- type: string
- description: The audio channel layout
- example: stereo
- samplingRate:
- type: integer
- description: Sampling rate of the audio stream in Hz
- example: 48000
- title:
- type: string
- description: Title of the subtitle track (for subtitle streams)
- example: English
- canAutoSync:
- type: boolean
- description: Indicates if the subtitle stream can auto-sync
- example: false
- Genre:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Adventure
- Country:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: United States of America
- Director:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: James Cameron
- Writer:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: James Cameron
- Collection:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Working NL Subs
- Role:
- type: array
- items:
- type: object
- properties:
- id:
- type: integer
- description: The ID of the tag or actor.
- example: 294129
- filter:
- type: string
- description: The filter used to find the actor or tag.
- example: actor=294129
- thumb:
- type: string
- description: The thumbnail of the actor
- example: 'https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg'
- tag:
- type: string
- description: The name of the tag or actor.
- example: Mike Smith
- tagKey:
- type: string
- description: Unique identifier for the tag.
- example: 668e7e7b22bcad9064350c91
- role:
- type: string
- description: The role of the actor or tag in the media.
- example: Self
- Location:
- type: array
- items:
- type: object
- properties:
- path:
- type: string
- example: /TV Shows/House
- Guid:
- x-speakeasy-name-override: MediaGuid
- description: |
- The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
- type: array
- items:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- description: |
- Can be one of the following formats:
- imdb://tt13015952, tmdb://2434012, tvdb://7945991
- example: 'imdb://tt13015952'
- UltraBlurColors:
- type: object
- required:
- - topLeft
- - topRight
- - bottomRight
- - bottomLeft
- properties:
- topLeft:
- type: string
- example: 11333b
- topRight:
- type: string
- example: 0a232d
- bottomRight:
- type: string
- example: 073958
- bottomLeft:
- type: string
- example: 1f5066
- Rating:
- x-speakeasy-name-override: MetaDataRating
- type: array
- items:
- type: object
- required:
- - image
- - value
- - type
- properties:
- image:
- type: string
- description: A URI or path to the rating image.
- example: 'themoviedb://image.rating'
- value:
- type: number
- format: float
- description: The value of the rating.
- example: 3
- type:
- type: string
- description: 'The type of rating (e.g., audience, critic).'
- example: audience
- Image:
- type: array
- items:
- type: object
- required:
- - alt
- - type
- - url
- properties:
- alt:
- type: string
- example: Episode 1
- type:
- type: string
- enum:
- - coverPoster
- - background
- - snapshot
- - clearLogo
- example: background
- url:
- type: string
- example: /library/metadata/45521/thumb/1644710589
- titleSort:
- type: string
- example: Whale
- viewCount:
- type: integer
- format: int32
- example: 1
- lastViewedAt:
- type: integer
- format: int32
- example: 1682752242
- originalTitle:
- type: string
- example: 映画 ブラッククローバー 魔法帝の剣
- viewOffset:
- type: integer
- format: int32
- example: 5222500
- skipCount:
- type: integer
- format: int32
- example: 1
- index:
- type: integer
- format: int32
- example: 1
- theme:
- type: string
- example: /library/metadata/1/theme/1705636920
- leafCount:
- type: integer
- format: int32
- example: 14
- viewedLeafCount:
- type: integer
- format: int32
- example: 0
- childCount:
- type: integer
- format: int32
- example: 1
- hasPremiumExtras:
- type: string
- example: '1'
- hasPremiumPrimaryExtra:
- type: string
- example: '1'
- parentRatingKey:
- type: string
- description: |
- The rating key of the parent item.
- example: '66'
- parentGuid:
- type: string
- example: 'plex://show/5d9c081b170e24001f2a7be4'
- parentStudio:
- type: string
- example: UCP
- parentKey:
- type: string
- example: /library/metadata/66
- parentTitle:
- type: string
- example: Caprica
- parentIndex:
- type: integer
- format: int32
- example: 1
- parentYear:
- type: integer
- format: int32
- example: 2010
- parentThumb:
- type: string
- example: /library/metadata/66/thumb/1705716261
- parentTheme:
- type: string
- example: /library/metadata/66/theme/1705716261
- '400':
- description: 'Bad request, invalid parameters.'
- '401':
- description: 'Unauthorized, invalid Plex token.'
- x-codeSamples:
- - lang: php
- label: added
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
- $request = new Operations\GetRecentlyAddedRequest(
- contentDirectoryID: 470161,
- sectionID: 2,
- type: Operations\Type::TvShow,
- );
-
- $response = $sdk->hubs->getRecentlyAdded(
- request: $request
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: added
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetRecentlyAddedRequest.new(\n content_directory_id: 470161,\n section_id: 2,\n type: ::PlexRubySDK::Operations::Type::TV_SHOW,\n include_meta: ::PlexRubySDK::Operations::IncludeMeta::ENABLE,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n)\n \nres = s.hubs.get_recently_added(req)\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: added
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Hubs.GetRecentlyAdded(ctx, operations.GetRecentlyAddedRequest{\n ContentDirectoryID: 470161,\n SectionID: plexgo.Int64(2),\n Type: operations.TypeTvShow,\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- lang: java
- label: added
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.operations.GetRecentlyAddedRequest;
- import dev.plexapi.plexapi.models.operations.GetRecentlyAddedResponse;
- import dev.plexapi.plexapi.models.operations.Type;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetAllHubsRequest;
+ import dev.plexapi.sdk.models.operations.GetAllHubsResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
@@ -4728,16 +2712,25 @@ paths:
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder()
- .contentDirectoryID(470161L)
- .type(Type.TvShow)
- .sectionID(2L)
+ GetAllHubsRequest req = GetAllHubsRequest.builder()
+ .onlyTransient(BoolInt.ONE)
.build();
- GetRecentlyAddedResponse res = sdk.hubs().getRecentlyAdded()
+ GetAllHubsResponse res = sdk.hubs().getAllHubs()
.request(req)
.call();
@@ -4747,34 +2740,516 @@ paths:
}
}
- lang: typescript
- label: added
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { Type } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts, BoolInt } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.hubs.getRecentlyAdded({
- contentDirectoryID: 470161,
- sectionID: 2,
- type: Type.TvShow,
+ const result = await plexAPI.hubs.getAllHubs({
+ onlyTransient: BoolInt.One,
});
- // Handle the result
+ console.log(result);
+ }
+
+ run();
+ /hubs/continueWatching:
+ get:
+ summary: Get the continue watching hub
+ operationId: getContinueWatching
+ description: Get the global continue watching hub
+ tags:
+ - Hubs
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - $ref: '#/components/parameters/count'
+ responses:
+ '200':
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ $ref: '#/components/headers/X-Plex-Container-Start'
+ X-Plex-Container-Total-Size:
+ $ref: '#/components/headers/X-Plex-Container-Total-Size'
+ content:
+ application/json:
+ schema:
+ properties:
+ MediaContainer:
+ allOf:
+ - $ref: '#/components/schemas/MediaContainer'
+ - properties:
+ Hub:
+ items:
+ $ref: '#/components/schemas/Hub'
+ type: array
+ type: object
+ type: object
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Hubs.GetContinueWatching(ctx, operations.GetContinueWatchingRequest{})
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetContinueWatchingRequest;
+ import dev.plexapi.sdk.models.operations.GetContinueWatchingResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ GetContinueWatchingRequest req = GetContinueWatchingRequest.builder()
+ .build();
+
+ GetContinueWatchingResponse res = sdk.hubs().getContinueWatching()
+ .request(req)
+ .call();
+
+ if (res.object().isPresent()) {
+ // handle response
+ }
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.hubs.getContinueWatching({});
+
+ console.log(result);
+ }
+
+ run();
+ /hubs/items:
+ get:
+ summary: Get a hub's items
+ operationId: getHubItems
+ description: Get the items within a single hub specified by identifier
+ tags:
+ - Hubs
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - $ref: '#/components/parameters/count'
+ - name: identifier
+ description: If provided, limit to only specified hubs
+ in: query
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ responses:
+ '200':
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ $ref: '#/components/headers/X-Plex-Container-Start'
+ X-Plex-Container-Total-Size:
+ $ref: '#/components/headers/X-Plex-Container-Total-Size'
+ content:
+ application/json:
+ schema:
+ properties:
+ MediaContainer:
+ $ref: '#/components/schemas/MediaContainer'
+ type: object
+ '404':
+ description: The specified hub could not be found
+ content:
+ text/html: {}
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Hubs.GetHubItems(ctx, operations.GetHubItemsRequest{
+ Identifier: []string{
+ "",
+ "",
+ "",
+ },
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetHubItemsRequest;
+ import dev.plexapi.sdk.models.operations.GetHubItemsResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+ import java.util.List;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ GetHubItemsRequest req = GetHubItemsRequest.builder()
+ .identifier(List.of(
+ "",
+ "",
+ ""))
+ .build();
+
+ GetHubItemsResponse res = sdk.hubs().getHubItems()
+ .request(req)
+ .call();
+
+ if (res.object().isPresent()) {
+ // handle response
+ }
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.hubs.getHubItems({
+ identifier: [
+ "",
+ "",
+ "",
+ ],
+ });
+
+ console.log(result);
+ }
+
+ run();
+ /hubs/promoted:
+ get:
+ summary: Get the hubs which are promoted
+ operationId: getPromotedHubs
+ description: Get the global hubs which are promoted (should be displayed on the home screen)
+ tags:
+ - Hubs
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - $ref: '#/components/parameters/count'
+ responses:
+ '200':
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ $ref: '#/components/headers/X-Plex-Container-Start'
+ X-Plex-Container-Total-Size:
+ $ref: '#/components/headers/X-Plex-Container-Total-Size'
+ content:
+ application/json:
+ schema:
+ properties:
+ MediaContainer:
+ allOf:
+ - $ref: '#/components/schemas/MediaContainer'
+ - properties:
+ Hub:
+ items:
+ $ref: '#/components/schemas/Hub'
+ type: array
+ type: object
+ type: object
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Hubs.GetPromotedHubs(ctx, operations.GetPromotedHubsRequest{})
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetPromotedHubsRequest;
+ import dev.plexapi.sdk.models.operations.GetPromotedHubsResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ GetPromotedHubsRequest req = GetPromotedHubsRequest.builder()
+ .build();
+
+ GetPromotedHubsResponse res = sdk.hubs().getPromotedHubs()
+ .request(req)
+ .call();
+
+ if (res.object().isPresent()) {
+ // handle response
+ }
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
+
+ const plexAPI = new PlexAPI({
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
+ });
+
+ async function run() {
+ const result = await plexAPI.hubs.getPromotedHubs({});
+
console.log(result);
}
run();
/hubs/search:
get:
- tags:
- - Search
- summary: Perform a search
- operationId: performSearch
+ summary: Search Hub
+ operationId: searchHubs
description: |
+ Perform a search and get the result as hubs
+
This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
In the response's items, the following extra attributes are returned to further describe or disambiguate the result:
@@ -4787,85 +3262,70 @@ paths:
- `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID.
This request is intended to be very fast, and called as the user types.
+ tags:
+ - Search
parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
- name: query
description: The query term
in: query
+ required: true
schema:
type: string
- examples:
- - arnold
- - dylan
- required: true
- name: sectionId
- description: 'This gives context to the search, and can result in re-ordering of search result hubs'
+ description: This gives context to the search, and can result in re-ordering of search result hubs.
in: query
schema:
- type: number
- required: false
+ type: integer
+ example: 1
- name: limit
- description: The number of items to return per hub
+ description: The number of items to return per hub. 3 if not specified
in: query
schema:
- type: number
- example: 5
- default: 3
+ type: integer
responses:
'200':
- description: The search results
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ $ref: '#/components/headers/X-Plex-Container-Start'
+ X-Plex-Container-Total-Size:
+ $ref: '#/components/headers/X-Plex-Container-Total-Size'
+ content:
+ application/json:
+ schema:
+ properties:
+ MediaContainer:
+ allOf:
+ - $ref: '#/components/schemas/MediaContainer'
+ - properties:
+ Hub:
+ items:
+ $ref: '#/components/schemas/Hub'
+ type: array
+ type: object
+ type: object
'400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
+ description: A required parameter was not given, the wrong type, or wrong value
content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ text/html: {}
+ '404':
+ description: Search restrictions result in no possible items found (such as searching no sections)
content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ text/html: {}
x-codeSamples:
- lang: php
- label: performSearch
+ label: PlexPHP
source: |-
declare(strict_types=1);
@@ -4882,8 +3342,7 @@ paths:
$response = $sdk->search->performSearch(
- query: 'dylan',
- sectionId: 9372.7,
+ query: 'arnold',
limit: 5
);
@@ -4892,142 +3351,202 @@ paths:
// handle response
}
- lang: ruby
- label: performSearch
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.search.perform_search(query=\"dylan\", section_id=9372.7, limit=5.0)\n\nif res.status_code == 200\n # handle response\nend"
+ label: PlexRuby
+ source: |-
+ require 'plex_ruby_sdk'
+
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
+
+ res = s.search.perform_search(query="dylan", section_id=9372.7, limit=5.0)
+
+ if res.status_code == 200
+ # handle response
+ end
- lang: go
- label: performSearch
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Search.PerformSearch(ctx, \"dylan\", nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Search.SearchHubs(ctx, operations.SearchHubsRequest{
+ Query: "",
+ SectionID: plexgo.Pointer[int64](1),
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
- lang: java
- label: performSearch
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.PerformSearchBadRequest;
- import dev.plexapi.plexapi.models.errors.PerformSearchUnauthorized;
- import dev.plexapi.plexapi.models.operations.PerformSearchResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.SearchHubsRequest;
+ import dev.plexapi.sdk.models.operations.SearchHubsResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws PerformSearchBadRequest, PerformSearchUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- PerformSearchResponse res = sdk.search().performSearch()
- .query("dylan")
- .sectionId(9487.88d)
- .limit(5d)
+ SearchHubsRequest req = SearchHubsRequest.builder()
+ .query("")
+ .sectionId(1L)
+ .build();
+
+ SearchHubsResponse res = sdk.search().searchHubs()
+ .request(req)
.call();
- // handle response
+ if (res.object().isPresent()) {
+ // handle response
+ }
}
}
- lang: typescript
- label: performSearch
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.search.performSearch("dylan");
+ const result = await plexAPI.search.searchHubs({
+ query: "",
+ sectionId: 1,
+ });
- // Handle the result
console.log(result);
}
run();
/hubs/search/voice:
get:
+ summary: Voice Search Hub
+ operationId: voiceSearchHubs
+ description: |
+ Perform a search tailored to voice input and get the result as hubs
+
+ This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. Whenever possible, clients should limit the search to the appropriate type.
+
+ Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
tags:
- Search
- summary: Perform a voice search
- operationId: performVoiceSearch
- description: "This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. \nIt uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. \nWhenever possible, clients should limit the search to the appropriate type. \nResults, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.\n"
parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
- name: query
description: The query term
in: query
+ required: true
schema:
type: string
- examples:
- - dead+poop
- required: true
- - name: sectionId
- description: 'This gives context to the search, and can result in re-ordering of search result hubs'
- in: query
- schema:
- type: number
- required: false
+ - $ref: '#/components/parameters/type'
- name: limit
- description: The number of items to return per hub
+ description: The number of items to return per hub. 3 if not specified
in: query
schema:
- type: number
- example: 5
- default: 3
- required: false
+ type: integer
responses:
'200':
- description: The search results
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ $ref: '#/components/headers/X-Plex-Container-Start'
+ X-Plex-Container-Total-Size:
+ $ref: '#/components/headers/X-Plex-Container-Total-Size'
+ content:
+ application/json:
+ schema:
+ properties:
+ MediaContainer:
+ allOf:
+ - $ref: '#/components/schemas/MediaContainer'
+ - properties:
+ Hub:
+ items:
+ $ref: '#/components/schemas/Hub'
+ type: array
+ type: object
+ type: object
'400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
+ description: A required parameter was not given, the wrong type, or wrong value
content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ text/html: {}
x-codeSamples:
- lang: php
- label: performVoiceSearch
+ label: PlexPHP
source: |-
declare(strict_types=1);
@@ -5045,7 +3564,6 @@ paths:
$response = $sdk->search->performVoiceSearch(
query: 'dead+poop',
- sectionId: 4094.8,
limit: 5
);
@@ -5054,501 +3572,98 @@ paths:
// handle response
}
- lang: ruby
- label: performVoiceSearch
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.search.perform_voice_search(query=\"dead+poop\", section_id=4094.8, limit=5.0)\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: performVoiceSearch
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Search.PerformVoiceSearch(ctx, \"dead+poop\", nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: performVoiceSearch
+ label: PlexRuby
source: |-
- package hello.world;
+ require 'plex_ruby_sdk'
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.PerformVoiceSearchBadRequest;
- import dev.plexapi.plexapi.models.errors.PerformVoiceSearchUnauthorized;
- import dev.plexapi.plexapi.models.operations.PerformVoiceSearchResponse;
- import java.lang.Exception;
+ s = ::PlexRubySDK::PlexAPI.new(
+ security: Models::Shared::Security.new(
+ access_token: "",
+ ),
+ )
- public class Application {
+ res = s.search.perform_voice_search(query="dead+poop", section_id=4094.8, limit=5.0)
- public static void main(String[] args) throws PerformVoiceSearchBadRequest, PerformVoiceSearchUnauthorized, Exception {
+ if res.status_code == 200
+ # handle response
+ end
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
- PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
- .query("dead+poop")
- .sectionId(4094.8d)
- .limit(5d)
- .call();
+ func main() {
+ ctx := context.Background()
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Search.VoiceSearchHubs(ctx, operations.VoiceSearchHubsRequest{
+ Query: "",
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
// handle response
}
}
- - lang: typescript
- label: performVoiceSearch
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.search.performVoiceSearch("dead+poop");
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/hubs/sections/{sectionId}':
- get:
- tags:
- - Hubs
- summary: Get library specific hubs
- description: |
- This endpoint will return a list of library specific hubs
- operationId: getLibraryHubs
- parameters:
- - name: sectionId
- description: the Id of the library to query
- in: path
- schema:
- type: number
- required: true
- - name: count
- description: The number of items to return with each hub.
- in: query
- schema:
- type: number
- required: false
- - name: onlyTransient
- description: 'Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).'
- in: query
- schema:
- type: integer
- enum:
- - 0
- - 1
- required: false
- responses:
- '200':
- description: The hubs specific to the library
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- type: object
- properties:
- size:
- type: integer
- format: int32
- example: 7
- allowSync:
- type: boolean
- example: true
- identifier:
- type: string
- example: com.plexapp.plugins.library
- librarySectionID:
- type: integer
- format: int32
- example: 1
- librarySectionTitle:
- type: string
- example: Movies
- librarySectionUUID:
- type: string
- example: 322a231a-b7f7-49f5-920f-14c61199cd30
- Hub:
- type: array
- items:
- type: object
- properties:
- key:
- type: string
- example: '/library/sections/1/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0'
- title:
- type: string
- example: Recently Played Movies
- type:
- type: string
- example: movie
- hubIdentifier:
- type: string
- example: movie.recentlyviewed.1
- context:
- type: string
- example: hub.movie.recentlyviewed
- size:
- type: integer
- format: int32
- example: 6
- more:
- type: boolean
- example: true
- style:
- type: string
- example: shelf
- hubKey:
- type: string
- example: '/library/metadata/66485,66098,57249,11449,5858,14944'
- Metadata:
- type: array
- items:
- type: object
- properties:
- ratingKey:
- type: string
- example: '14944'
- key:
- type: string
- example: /library/metadata/14944
- guid:
- type: string
- example: 'plex://movie/5d77686eeb5d26001f1eb339'
- studio:
- type: string
- example: Walt Disney Animation Studios
- type:
- type: string
- example: movie
- title:
- type: string
- example: Tangled
- librarySectionTitle:
- type: string
- example: Movies
- librarySectionID:
- type: integer
- format: int32
- example: 1
- librarySectionKey:
- type: string
- example: /library/sections/1
- contentRating:
- type: string
- example: PG
- summary:
- type: string
- example: 'The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is.'
- rating:
- type: number
- example: 8.9
- audienceRating:
- type: number
- example: 8.7
- viewCount:
- type: integer
- format: int32
- example: 1
- lastViewedAt:
- type: integer
- format: int32
- example: 1704936047
- year:
- type: integer
- format: int32
- example: 2010
- tagline:
- type: string
- example: They're taking adventure to new lengths.
- thumb:
- type: string
- example: /library/metadata/14944/thumb/1705739847
- art:
- type: string
- example: /library/metadata/14944/art/1705739847
- duration:
- type: integer
- format: int32
- example: 6017237
- originallyAvailableAt:
- type: string
- format: date
- example: 2010-11-24T00:00:00.000Z
- addedAt:
- type: integer
- format: int32
- example: 1589412494
- updatedAt:
- type: integer
- format: int32
- example: 1705739847
- audienceRatingImage:
- type: string
- example: 'rottentomatoes://image.rating.upright'
- primaryExtraKey:
- type: string
- example: /library/metadata/14952
- ratingImage:
- type: string
- example: 'rottentomatoes://image.rating.ripe'
- Media:
- type: array
- items:
- type: object
- properties:
- id:
- type: integer
- format: int32
- example: 38247
- duration:
- type: integer
- format: int32
- example: 6017237
- bitrate:
- type: integer
- format: int32
- example: 2051
- width:
- type: integer
- format: int32
- example: 1920
- height:
- type: integer
- format: int32
- example: 1080
- aspectRatio:
- type: number
- example: 1.78
- audioChannels:
- type: integer
- format: int32
- example: 2
- audioCodec:
- type: string
- example: aac
- videoCodec:
- type: string
- example: h264
- videoResolution:
- type: string
- example: '1080'
- container:
- type: string
- example: mp4
- videoFrameRate:
- type: string
- example: 24p
- optimizedForStreaming:
- type: integer
- format: int32
- example: 1
- audioProfile:
- type: string
- example: lc
- has64bitOffsets:
- type: boolean
- example: false
- videoProfile:
- type: string
- example: high
- Part:
- type: array
- items:
- type: object
- properties:
- id:
- type: integer
- format: int32
- example: 38247
- key:
- type: string
- example: /library/parts/38247/1589412494/file.mp4
- duration:
- type: integer
- format: int32
- example: 6017237
- file:
- type: string
- example: /movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4
- size:
- type: integer
- format: int32
- example: 1545647447
- audioProfile:
- type: string
- example: lc
- container:
- type: string
- example: mp4
- has64bitOffsets:
- type: boolean
- example: false
- optimizedForStreaming:
- type: boolean
- example: true
- videoProfile:
- type: string
- example: high
- Genre:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Animation
- Country:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: United States of America
- Director:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Nathan Greno
- Role:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Donna Murphy
- Writer:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Wilhelm Grimm
- skipCount:
- type: integer
- format: int32
- example: 1
- chapterSource:
- type: string
- example: media
- promoted:
- type: boolean
- example: true
- random:
- type: boolean
- example: true
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: getLibraryHubs
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->hubs->getLibraryHubs(
- sectionId: 6728.76,
- count: 639.24,
- onlyTransient: Operations\QueryParamOnlyTransient::One
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: getLibraryHubs
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.hubs.get_library_hubs(section_id=6728.76, count=639.24, only_transient=::PlexRubySDK::Operations::QueryParamOnlyTransient::ONE)\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: getLibraryHubs
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Hubs.GetLibraryHubs(ctx, 6728.76, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- lang: java
- label: getLibraryHubs
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetLibraryHubsBadRequest;
- import dev.plexapi.plexapi.models.errors.GetLibraryHubsUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetLibraryHubsResponse;
- import dev.plexapi.plexapi.models.operations.QueryParamOnlyTransient;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.VoiceSearchHubsRequest;
+ import dev.plexapi.sdk.models.operations.VoiceSearchHubsResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetLibraryHubsBadRequest, GetLibraryHubsUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
- .sectionId(6728.76d)
- .count(6728.76d)
- .onlyTransient(QueryParamOnlyTransient.ZERO)
+ VoiceSearchHubsRequest req = VoiceSearchHubsRequest.builder()
+ .query("")
+ .build();
+
+ VoiceSearchHubsResponse res = sdk.search().voiceSearchHubs()
+ .request(req)
.call();
if (res.object().isPresent()) {
@@ -5557,71 +3672,68 @@ paths:
}
}
- lang: typescript
- label: getLibraryHubs
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.hubs.getLibraryHubs(6728.76);
+ const result = await plexAPI.search.voiceSearchHubs({
+ query: "",
+ });
- // Handle the result
console.log(result);
}
run();
/identity:
get:
+ summary: Get PMS identity
+ operationId: getIdentity
+ description: Get details about this PMS's identity
tags:
- - Server
- summary: Get Server Identity
- description: This request is useful to determine if the server is online or offline
- operationId: get-server-identity
- security: []
+ - General
+ security:
+ - {}
responses:
'200':
- description: The Server Identity information
+ description: OK
content:
application/json:
schema:
- type: object
properties:
MediaContainer:
- type: object
properties:
- size:
- type: number
- example: 0
claimed:
+ description: Indicates whether this server has been claimed by a user
type: boolean
machineIdentifier:
+ description: A unique identifier of the computer
type: string
- example: 96f2fe7a78c9dc1f16a16bedbe90f98149be16b4
+ size:
+ type: integer
version:
+ description: The full version string of the PMS
type: string
- example: 1.31.3.6868-28fc46b27
- '408':
- description: Request Timeout
- content:
- application/json:
- schema:
- x-speakeasy-name-override: RequestTimeout
+ type: object
type: object
- properties:
- code:
- type: integer
- format: int32
- example: 408
- message:
- type: string
- x-speakeasy-error-message: true
- example: The server timed out waiting for the request.
x-codeSamples:
- lang: php
- label: identity
+ label: PlexPHP
source: |-
declare(strict_types=1);
@@ -5641,29 +3753,58 @@ paths:
// handle response
}
- lang: ruby
- label: identity
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\n\n \nres = s.server.get_server_identity()\n\nif ! res.object.nil?\n # handle response\nend"
+ label: PlexRuby
+ source: |-
+ require 'plex_ruby_sdk'
+
+ s = ::PlexRubySDK::PlexAPI.new
+
+ res = s.server.get_server_identity()
+
+ if ! res.object.nil?
+ # handle response
+ end
- lang: go
- label: identity
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Server.GetServerIdentity(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New()
+
+ res, err := s.General.GetIdentity(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.Object != nil {
+ // handle response
+ }
+ }
- lang: java
- label: identity
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetServerIdentityRequestTimeout;
- import dev.plexapi.plexapi.models.operations.GetServerIdentityResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetIdentityResponse;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.build();
- GetServerIdentityResponse res = sdk.server().getServerIdentity()
+ GetIdentityResponse res = sdk.general().getIdentity()
.call();
if (res.object().isPresent()) {
@@ -5672,10983 +3813,3552 @@ paths:
}
}
- lang: typescript
- label: identity
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI();
async function run() {
- const result = await plexAPI.server.getServerIdentity();
+ const result = await plexAPI.general.getIdentity();
- // Handle the result
console.log(result);
}
run();
- /library/hashes:
+ /library/all:
get:
+ summary: Get all items in library
+ operationId: getLibraryItems
+ description: Request all metadata items according to a query.
tags:
- Library
- summary: Get Hash Value
- description: This resource returns hash values for local files
- operationId: getFileHash
parameters:
- - name: url
- description: 'This is the path to the local file, must be prefixed by `file://`'
- in: query
- schema:
- type: string
- example: 'file://C:\Image.png&type=13'
- required: true
- - name: type
- description: Item type
- in: query
- schema:
- type: number
- required: false
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - $ref: '#/components/parameters/mediaQuery'
responses:
'200':
- description: The hash of the file
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ description: Provided on all MediaContainer objects indicating the offset of where this container page starts
+ schema:
+ type: integer
+ X-Plex-Container-Total-Size:
+ description: Provided on all MediaContainer objects indicating the total size of objects available
+ schema:
+ type: integer
content:
application/json:
schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ $ref: '#/components/schemas/MediaContainerWithMetadata'
x-codeSamples:
- - lang: php
- label: getFileHash
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->getFileHash(
- url: 'file://C:\Image.png&type=13',
- type: 4462.17
-
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: getFileHash
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_file_hash(url=\"file://C:\\Image.png&type=13\", type=4462.17)\n\nif res.status_code == 200\n # handle response\nend"
- lang: go
- label: getFileHash
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetFileHash(ctx, \"file://C:\\Image.png&type=13\", nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: getFileHash
+ label: PlexGO
source: |-
- package hello.world;
+ package main
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetFileHashBadRequest;
- import dev.plexapi.plexapi.models.errors.GetFileHashUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetFileHashResponse;
- import java.lang.Exception;
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
- public class Application {
+ func main() {
+ ctx := context.Background()
- public static void main(String[] args) throws GetFileHashBadRequest, GetFileHashUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetFileHashResponse res = sdk.library().getFileHash()
- .url("file://C:\Image.png&type=13")
- .type(4462.17d)
- .call();
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+ res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{})
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.MediaContainerWithMetadata != nil {
// handle response
}
}
- - lang: typescript
- label: getFileHash
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13");
-
- // Handle the result
- console.log(result);
- }
-
- run();
- /library/recentlyAdded:
- get:
- tags:
- - Library
- summary: Get Recently Added
- description: |
- This endpoint will return the recently added content.
- operationId: get-recently-added-library
- parameters:
- - name: contentDirectoryID
- in: query
- required: false
- schema:
- type: integer
- example: 2
- - name: pinnedContentDirectoryID
- in: query
- required: false
- schema:
- type: array
- items:
- type: integer
- example:
- - 3
- - 5
- - 7
- - 13
- - 12
- - 1
- - 6
- - 14
- - 2
- - 10
- - 16
- - 17
- - name: sectionID
- in: query
- required: false
- description: The library section ID for filtering content.
- schema:
- type: integer
- example: 2
- - name: type
- in: query
- description: |
- The type of media to retrieve or filter by.
- 1 = movie
- 2 = show
- 3 = season
- 4 = episode
- E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
- schema:
- type: integer
- enum:
- - 1
- - 2
- - 3
- - 4
- - 8
- - 9
- - 10
- example: 2
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - AUDIO
- - ALBUM
- - TRACK
- required: true
- - name: includeMeta
- in: query
- description: |
- Adds the Meta object to the response
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: X-Plex-Container-Start
- in: query
- description: |
- The index of the first item to return. If not specified, the first item will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 0
- schema:
- type: integer
- format: int32
- default: 0
- example: 0
- required: false
- - name: X-Plex-Container-Size
- in: query
- description: |
- The number of items to return. If not specified, all items will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 50
- schema:
- type: integer
- format: int32
- default: 50
- example: 50
- required: false
- responses:
- '200':
- description: The recently added content
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- allOf:
- - type: object
- description: |
- The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
- properties:
- Type:
- type: array
- items:
- type: object
- required:
- - key
- - type
- - title
- - active
- properties:
- key:
- type: string
- example: /library/sections/2/all?type=2
- type:
- type: string
- example: filter
- subtype:
- type: string
- example: clip
- title:
- type: string
- example: TV Shows
- active:
- type: boolean
- example: false
- Filter:
- type: array
- items:
- type: object
- required:
- - filter
- - filterType
- - key
- - title
- - type
- properties:
- filter:
- type: string
- example: genre
- filterType:
- type: string
- example: string
- key:
- type: string
- example: /library/sections/2/genre?type=2
- title:
- type: string
- example: Genre
- type:
- type: string
- example: filter
- advanced:
- type: boolean
- example: true
- Sort:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - defaultDirection
- properties:
- default:
- type: string
- example: asc
- active:
- type: boolean
- example: false
- activeDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- defaultDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- descKey:
- type: string
- example: 'titleSort:desc'
- firstCharacterKey:
- type: string
- example: /library/sections/2/firstCharacter
- key:
- type: string
- example: titleSort
- title:
- type: string
- example: Title
- Field:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - type
- properties:
- key:
- type: string
- example: show.title
- title:
- type: string
- example: Show Title
- type:
- type: string
- example: string
- subType:
- type: string
- example: rating
- FieldType:
- type: array
- items:
- type: object
- required:
- - type
- - Operator
- properties:
- type:
- type: string
- example: tag
- Operator:
- type: array
- items:
- type: object
- required:
- - key
- - title
- properties:
- key:
- type: string
- example: '='
- title:
- type: string
- example: is
- - type: object
- properties:
- size:
- type: number
- example: 50
- allowSync:
- type: boolean
- identifier:
- type: string
- example: com.plexapp.plugins.library
- mediaTagPrefix:
- type: string
- example: /system/bundle/media/flags/
- mediaTagVersion:
- type: number
- example: 1680021154
- mixedParents:
- type: boolean
- Metadata:
- type: array
- items:
- type: object
- properties:
- allowSync:
- type: boolean
- librarySectionID:
- type: number
- example: 1
- librarySectionTitle:
- type: string
- example: Movies
- librarySectionUUID:
- type: string
- example: 322a231a-b7f7-49f5-920f-14c61199cd30
- ratingKey:
- type: number
- example: 59398
- key:
- type: string
- example: /library/metadata/59398
- guid:
- type: string
- example: 'plex://movie/5e161a83bea6ac004126e148'
- studio:
- type: string
- example: Marvel Studios
- type:
- type: string
- example: movie
- title:
- type: string
- example: 'Ant-Man and the Wasp: Quantumania'
- contentRating:
- type: string
- example: PG-13
- summary:
- type: string
- example: Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.
- rating:
- type: number
- example: 4.7
- audienceRating:
- type: number
- example: 8.3
- year:
- type: number
- example: 2023
- tagline:
- type: string
- example: Witness the beginning of a new dynasty.
- thumb:
- type: string
- example: /library/metadata/59398/thumb/1681888010
- art:
- type: string
- example: /library/metadata/59398/art/1681888010
- duration:
- type: number
- example: 7474422
- originallyAvailableAt:
- type: string
- format: date-time
- example: 2023-02-15T00:00:00.000Z
- addedAt:
- type: number
- example: 1681803215
- updatedAt:
- type: number
- example: 1681888010
- audienceRatingImage:
- type: string
- example: 'rottentomatoes://image.rating.upright'
- chapterSource:
- type: string
- example: media
- primaryExtraKey:
- type: string
- example: /library/metadata/59399
- ratingImage:
- type: string
- example: 'rottentomatoes://image.rating.rotten'
- Media:
- type: array
- items:
- type: object
- properties:
- id:
- type: number
- example: 120345
- duration:
- type: number
- example: 7474422
- bitrate:
- type: number
- example: 3623
- width:
- type: number
- example: 1920
- height:
- type: number
- example: 804
- aspectRatio:
- type: number
- example: 2.35
- audioChannels:
- type: number
- example: 6
- audioCodec:
- type: string
- example: ac3
- videoCodec:
- type: string
- example: h264
- videoResolution:
- type: number
- example: 1080
- container:
- type: string
- example: mp4
- videoFrameRate:
- type: string
- example: 24p
- optimizedForStreaming:
- type: number
- example: 0
- has64bitOffsets:
- type: boolean
- videoProfile:
- type: string
- example: high
- Part:
- type: array
- items:
- type: object
- properties:
- id:
- type: number
- example: 120353
- key:
- type: string
- example: /library/parts/120353/1681803203/file.mp4
- duration:
- type: number
- example: 7474422
- file:
- type: string
- example: /movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4
- size:
- type: number
- example: 3395307162
- container:
- type: string
- example: mp4
- has64bitOffsets:
- type: boolean
- hasThumbnail:
- type: number
- example: 1
- optimizedForStreaming:
- type: boolean
- videoProfile:
- type: string
- example: high
- Genre:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Comedy
- Director:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Peyton Reed
- Writer:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Jeff Loveness
- Country:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: United States of America
- Role:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Paul Rudd
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: library
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
- $request = new Operations\GetRecentlyAddedLibraryRequest(
- contentDirectoryID: 2,
- pinnedContentDirectoryID: [
- 3,
- 5,
- 7,
- 13,
- 12,
- 1,
- 6,
- 14,
- 2,
- 10,
- 16,
- 17,
- ],
- sectionID: 2,
- type: Operations\QueryParamType::TvShow,
- );
-
- $response = $sdk->library->getRecentlyAddedLibrary(
- request: $request
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: library
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetRecentlyAddedLibraryRequest.new(\n content_directory_id: 2,\n pinned_content_directory_id: [\n 3,\n 5,\n 7,\n 13,\n 12,\n 1,\n 6,\n 14,\n 2,\n 10,\n 16,\n 17,\n ],\n section_id: 2,\n type: ::PlexRubySDK::Operations::QueryParamType::TV_SHOW,\n include_meta: ::PlexRubySDK::Operations::QueryParamIncludeMeta::ENABLE,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n)\n \nres = s.library.get_recently_added_library(req)\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: library
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetRecentlyAddedLibrary(ctx, operations.GetRecentlyAddedLibraryRequest{\n ContentDirectoryID: plexgo.Int64(2),\n PinnedContentDirectoryID: []int64{\n 3,\n 5,\n 7,\n 13,\n 12,\n 1,\n 6,\n 14,\n 2,\n 10,\n 16,\n 17,\n },\n SectionID: plexgo.Int64(2),\n Type: operations.QueryParamTypeTvShow,\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- lang: java
- label: library
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetRecentlyAddedLibraryBadRequest;
- import dev.plexapi.plexapi.models.errors.GetRecentlyAddedLibraryUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetRecentlyAddedLibraryRequest;
- import dev.plexapi.plexapi.models.operations.GetRecentlyAddedLibraryResponse;
- import dev.plexapi.plexapi.models.operations.QueryParamType;
- import java.lang.Exception;
- import java.util.List;
-
- public class Application {
-
- public static void main(String[] args) throws GetRecentlyAddedLibraryBadRequest, GetRecentlyAddedLibraryUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder()
- .type(QueryParamType.TvShow)
- .contentDirectoryID(2L)
- .pinnedContentDirectoryID(List.of(
- 3L,
- 5L,
- 7L,
- 13L,
- 12L,
- 1L,
- 6L,
- 14L,
- 2L,
- 10L,
- 16L,
- 17L))
- .sectionID(2L)
- .build();
-
- GetRecentlyAddedLibraryResponse res = sdk.library().getRecentlyAddedLibrary()
- .request(req)
- .call();
-
- if (res.object().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: library
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
- import { QueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.library.getRecentlyAddedLibrary({
- contentDirectoryID: 2,
- pinnedContentDirectoryID: [
- 3,
- 5,
- 7,
- 13,
- 12,
- 1,
- 6,
- 14,
- 2,
- 10,
- 16,
- 17,
- ],
- sectionID: 2,
- type: QueryParamType.TvShow,
- });
-
- // Handle the result
- console.log(result);
- }
-
- run();
- /library/sections:
- get:
- tags:
- - Library
- summary: Get All Libraries
- operationId: get-all-libraries
- description: "A library section (commonly referred to as just a library) is a collection of media. \nLibraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. \nFor example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.\n\nLibraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. \nThis allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).\n"
- responses:
- '200':
- description: The libraries available on the Server
- content:
- application/json:
- schema:
- type: object
- required:
- - MediaContainer
- properties:
- MediaContainer:
- type: object
- required:
- - size
- - allowSync
- - title1
- - Directory
- properties:
- size:
- type: integer
- format: int32
- example: 5
- allowSync:
- type: boolean
- example: false
- title1:
- type: string
- example: Plex Library
- Directory:
- type: array
- items:
- type: object
- required:
- - allowSync
- - art
- - composite
- - filters
- - refreshing
- - thumb
- - key
- - type
- - title
- - agent
- - scanner
- - language
- - uuid
- - updatedAt
- - createdAt
- - scannedAt
- - content
- - directory
- - contentChangedAt
- - hidden
- - Location
- properties:
- allowSync:
- type: boolean
- example: true
- art:
- type: string
- example: '/:/resources/movie-fanart.jpg'
- composite:
- type: string
- example: /library/sections/1/composite/1705615584
- filters:
- type: boolean
- example: true
- refreshing:
- type: boolean
- example: false
- thumb:
- type: string
- example: '/:/resources/movie.png'
- key:
- type: string
- example: '1'
- type:
- type: string
- example: movie
- title:
- type: string
- example: Movies
- agent:
- type: string
- example: tv.plex.agents.movie
- scanner:
- type: string
- example: Plex Movie
- language:
- type: string
- example: en-US
- uuid:
- type: string
- example: 322a231a-b7f7-49f5-920f-14c61199cd30
- updatedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- createdAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- scannedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- content:
- type: boolean
- example: true
- directory:
- type: boolean
- example: true
- contentChangedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- hidden:
- type: integer
- format: int32
- example: 0
- Location:
- type: array
- items:
- type: object
- required:
- - id
- - path
- properties:
- id:
- type: integer
- format: int32
- example: 1
- path:
- type: string
- example: /movies
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: libraries
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->getAllLibraries(
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: libraries
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_all_libraries()\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: libraries
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetAllLibraries(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: libraries
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetAllLibrariesBadRequest;
- import dev.plexapi.plexapi.models.errors.GetAllLibrariesUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetAllLibrariesResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest;
+ import dev.plexapi.sdk.models.operations.GetLibraryItemsResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetAllLibrariesBadRequest, GetAllLibrariesUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetAllLibrariesResponse res = sdk.library().getAllLibraries()
- .call();
-
- if (res.object().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: libraries
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.library.getAllLibraries();
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/library/sections/{sectionKey}':
- get:
- tags:
- - Library
- summary: Get Library Details
- description: "## Library Details Endpoint\n\nThis endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself. \n\nThe details include:\n\n### Directories\nOrganized into three categories:\n\n- **Primary Directories**: \n - Used in some clients for quick access to media subsets (e.g., \"All\", \"On Deck\").\n - Most can be replicated via media queries.\n - Customizable by users.\n\n- **Secondary Directories**:\n - Marked with `secondary=\"1\"`.\n - Used in older clients for structured navigation.\n\n- **Special Directories**:\n - Includes a \"By Folder\" entry for filesystem-based browsing.\n - Contains an obsolete `search=\"1\"` entry for on-the-fly search dialog creation.\n\n### Types\nEach type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:\n\n- **Type Object Attributes**:\n - `key`: Endpoint for the media list of this type.\n - `type`: Metadata type (if standard Plex type).\n - `title`: Title for this content type (e.g., \"Movies\").\n\n- **Filter Objects**:\n - Subset of the media query language.\n - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.\n\n- **Sort Objects**:\n - Description of sort fields.\n - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.\n\n> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.\n"
- operationId: get-library-details
- parameters:
- - name: includeDetails
- description: "Whether or not to include details for a section (types, filters, and sorts). \nOnly exists for backwards compatibility, media providers other than the server libraries have it on always.\n"
- in: query
- schema:
- type: integer
- enum:
- - 0
- - 1
- default: 0
- required: false
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- responses:
- '200':
- description: The details of the library
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- type: object
- properties:
- size:
- type: integer
- format: int32
- example: 29
- allowSync:
- type: boolean
- example: false
- art:
- type: string
- example: '/:/resources/movie-fanart.jpg'
- content:
- type: string
- example: secondary
- identifier:
- type: string
- example: com.plexapp.plugins.library
- librarySectionID:
- type: integer
- format: int32
- example: 1
- mediaTagPrefix:
- type: string
- example: /system/bundle/media/flags/
- mediaTagVersion:
- type: integer
- format: int32
- example: 1701731894
- thumb:
- type: string
- example: '/:/resources/movie.png'
- title1:
- type: string
- example: Movies
- viewGroup:
- type: string
- example: secondary
- viewMode:
- type: integer
- format: int32
- example: 65592
- Directory:
- type: array
- items:
- type: object
- properties:
- key:
- type: string
- example: search?type=1
- title:
- type: string
- example: Search...
- secondary:
- type: boolean
- example: true
- prompt:
- type: string
- example: Search Movies
- search:
- type: boolean
- example: true
- Type:
- type: array
- items:
- type: object
- properties:
- key:
- type: string
- example: /library/sections/1/all?type=1
- type:
- type: string
- example: movie
- title:
- type: string
- example: Movies
- active:
- type: boolean
- example: false
- Filter:
- type: array
- items:
- type: object
- properties:
- filter:
- type: string
- example: label
- filterType:
- type: string
- example: string
- key:
- type: string
- example: /library/sections/1/label
- title:
- type: string
- example: Labels
- type:
- type: string
- example: filter
- Sort:
- type: array
- items:
- type: object
- properties:
- default:
- type: string
- example: asc
- defaultDirection:
- type: string
- example: desc
- descKey:
- type: string
- example: 'random:desc'
- firstCharacterKey:
- type: string
- example: /library/sections/1/firstCharacter
- key:
- type: string
- example: random
- title:
- type: string
- example: Randomly
- Field:
- type: array
- items:
- type: object
- properties:
- key:
- type: string
- example: label
- title:
- type: string
- example: Label
- type:
- type: string
- example: tag
- subType:
- type: string
- example: bitrate
- FieldType:
- type: array
- items:
- type: object
- properties:
- type:
- type: string
- example: resolution
- Operator:
- type: array
- items:
- type: object
- properties:
- key:
- type: string
- example: '='
- title:
- type: string
- example: is
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: details
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->getLibraryDetails(
- sectionKey: 9518,
- includeDetails: Operations\IncludeDetails::Zero
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: details
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_library_details(section_key=9518, include_details=::PlexRubySDK::Operations::IncludeDetails::ZERO)\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: details
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetLibraryDetails(ctx, 9518, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: details
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetLibraryDetailsBadRequest;
- import dev.plexapi.plexapi.models.errors.GetLibraryDetailsUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetLibraryDetailsResponse;
- import dev.plexapi.plexapi.models.operations.IncludeDetails;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetLibraryDetailsBadRequest, GetLibraryDetailsUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
- .includeDetails(IncludeDetails.ZERO)
- .sectionKey(9518)
- .call();
-
- if (res.object().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: details
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.library.getLibraryDetails(9518);
-
- // Handle the result
- console.log(result);
- }
-
- run();
- delete:
- tags:
- - Library
- summary: Delete Library Section
- description: Delete a library using a specific section id
- operationId: deleteLibrary
- parameters:
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- responses:
- '200':
- description: The library is deleted
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: deleteLibrary
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->deleteLibrary(
- sectionKey: 9518
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: deleteLibrary
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.delete_library(section_key=9518)\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: deleteLibrary
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.DeleteLibrary(ctx, 9518)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- - lang: java
- label: deleteLibrary
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.DeleteLibraryBadRequest;
- import dev.plexapi.plexapi.models.errors.DeleteLibraryUnauthorized;
- import dev.plexapi.plexapi.models.operations.DeleteLibraryResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws DeleteLibraryBadRequest, DeleteLibraryUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- DeleteLibraryResponse res = sdk.library().deleteLibrary()
- .sectionKey(9518)
- .call();
-
- // handle response
- }
- }
- - lang: typescript
- label: deleteLibrary
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.library.deleteLibrary(9518);
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/library/sections/watchlist/{filter}':
- servers:
- - url: 'https://metadata.provider.plex.tv'
- description: The plex metadata provider server
- get:
- tags:
- - Watchlist
- summary: Get User Watchlist
- description: Get User Watchlist
- operationId: get-watch-list
- parameters:
- - name: filter
- description: Filter
- in: path
- required: true
- schema:
- type: string
- enum:
- - all
- - available
- - released
- - name: sort
- description: |
- In the format "field:dir". Available fields are "watchlistedAt" (Added At),
- "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
- "dir" can be "asc" or "desc"
- in: query
- required: false
- schema:
- type: string
- - name: libtype
- description: |
- The type of library to filter. Can be "movie" or "show", or all if not present.
- in: query
- required: false
- schema:
- type: string
- enum:
- - movie
- - show
- - name: maxresults
- description: |
- The number of items to return. If not specified, all items will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- in: query
- required: false
- schema:
- type: integer
- format: int32
- - name: includeCollections
- description: |
- include collections in the results
- in: query
- required: false
- schema:
- type: integer
- enum:
- - 1
- - 0
- - name: includeExternalMedia
- description: |
- include external media in the results
- in: query
- required: false
- schema:
- type: integer
- enum:
- - 1
- - 0
- - name: Accept
- in: header
- required: false
- schema:
- type: string
- enum:
- - application/json
- - application/xml
- example: application/json
- - name: X-Plex-Container-Start
- in: query
- description: |
- The index of the first item to return. If not specified, the first item will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 0
- schema:
- type: integer
- format: int32
- default: 0
- example: 0
- required: false
- - name: X-Plex-Container-Size
- in: query
- description: |
- The number of items to return. If not specified, all items will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 50
- schema:
- type: integer
- format: int32
- default: 50
- example: 50
- required: false
- - name: X-Plex-Token
- in: header
- description: 'An authentication token, obtained from plex.tv'
- required: true
- schema:
- type: string
- example: CV5xoxjTpFKUzBTShsaf
- responses:
- '200':
- description: Watchlist Data
- content:
- application/json:
- schema:
- type: object
- properties:
- librarySectionID:
- type: string
- librarySectionTitle:
- type: string
- offset:
- type: integer
- format: int32
- totalSize:
- type: integer
- format: int32
- identifier:
- type: string
- size:
- type: integer
- format: int32
- Metadata:
- type: array
- items:
- type: object
- properties:
- art:
- type: string
- guid:
- type: string
- key:
- type: string
- ratingKey:
- type: string
- studio:
- type: string
- tagline:
- type: string
- type:
- type: string
- thumb:
- type: string
- addedAt:
- type: integer
- format: int32
- duration:
- type: integer
- format: int32
- publicPagesURL:
- type: string
- slug:
- type: string
- userState:
- type: boolean
- title:
- type: string
- contentRating:
- type: string
- originallyAvailableAt:
- type: string
- format: date
- year:
- type: integer
- format: int32
- Image:
- type: array
- items:
- type: object
- properties:
- alt:
- type: string
- type:
- type: string
- url:
- type: string
- banner:
- type: string
- rating:
- type: number
- expiresAt:
- type: integer
- format: int32
- originalTitle:
- type: string
- audienceRating:
- type: number
- audienceRatingImage:
- type: string
- ratingImage:
- type: string
- imdbRatingCount:
- type: integer
- format: int32
- subtype:
- type: string
- theme:
- type: string
- leafCount:
- type: integer
- format: int32
- childCount:
- type: integer
- format: int32
- isContinuingSeries:
- type: boolean
- skipChildren:
- type: boolean
- availabilityId:
- type: string
- streamingMediaId:
- type: string
- playableKey:
- type: string
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: list
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
- $request = new Operations\GetWatchListRequest(
- filter: Operations\Filter::Available,
- xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
- );
-
- $response = $sdk->watchlist->getWatchList(
- request: $request
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: list
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetWatchListRequest.new(\n filter: ::PlexRubySDK::Operations::Filter::AVAILABLE,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n x_plex_token: \"CV5xoxjTpFKUzBTShsaf\",\n)\n \nres = s.watchlist.get_watch_list(req)\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: list
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Watchlist.GetWatchList(ctx, operations.GetWatchListRequest{\n Filter: operations.FilterAvailable,\n XPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: list
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetWatchListBadRequest;
- import dev.plexapi.plexapi.models.errors.GetWatchListUnauthorized;
- import dev.plexapi.plexapi.models.operations.Filter;
- import dev.plexapi.plexapi.models.operations.GetWatchListRequest;
- import dev.plexapi.plexapi.models.operations.GetWatchListResponse;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetWatchListBadRequest, GetWatchListUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetWatchListRequest req = GetWatchListRequest.builder()
- .filter(Filter.AVAILABLE)
- .xPlexToken("CV5xoxjTpFKUzBTShsaf")
- .build();
-
- GetWatchListResponse res = sdk.watchlist().getWatchList()
- .request(req)
- .call();
-
- if (res.object().isPresent()) {
- // handle response
- }
- }
- }
- - lang: typescript
- label: list
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
- import { Filter } from "@lukehagar/plexjs/sdk/models/operations";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.watchlist.getWatchList({
- filter: Filter.Available,
- xPlexToken: "CV5xoxjTpFKUzBTShsaf",
- });
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/library/sections/{sectionKey}/{tag}':
- get:
- tags:
- - Library
- summary: Get Library Items
- operationId: get-library-items
- description: |
- Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
- - `all`: All items in the section.
- - `unwatched`: Items that have not been played.
- - `newest`: Items that are recently released.
- - `recentlyAdded`: Items that are recently added to the library.
- - `recentlyViewed`: Items that were recently viewed.
- - `onDeck`: Items to continue watching.
- - `collection`: Items categorized by collection.
- - `edition`: Items categorized by edition.
- - `genre`: Items categorized by genre.
- - `year`: Items categorized by year of release.
- - `decade`: Items categorized by decade.
- - `director`: Items categorized by director.
- - `actor`: Items categorized by starring actor.
- - `country`: Items categorized by country of origin.
- - `contentRating`: Items categorized by content rating.
- - `rating`: Items categorized by rating.
- - `resolution`: Items categorized by resolution.
- - `firstCharacter`: Items categorized by the first letter.
- - `folder`: Items categorized by folder.
- - `albums`: Items categorized by album.
- parameters:
- - name: tag
- in: path
- required: true
- description: A key representing a specific tag within the section.
- schema:
- type: string
- enum:
- - unwatched
- - newest
- - recentlyAdded
- - recentlyViewed
- - onDeck
- - collection
- - edition
- - year
- - decade
- - director
- - contentRating
- - rating
- - resolution
- - firstCharacter
- - folder
- - albums
- - name: includeGuids
- in: query
- description: |
- Adds the Guids object to the response
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: type
- in: query
- description: |
- The type of media to retrieve or filter by.
- 1 = movie
- 2 = show
- 3 = season
- 4 = episode
- E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
- schema:
- type: integer
- enum:
- - 1
- - 2
- - 3
- - 4
- - 8
- - 9
- - 10
- example: 2
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - AUDIO
- - ALBUM
- - TRACK
- required: true
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- - name: includeMeta
- in: query
- description: |
- Adds the Meta object to the response
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: X-Plex-Container-Start
- in: query
- description: |
- The index of the first item to return. If not specified, the first item will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 0
- schema:
- type: integer
- format: int32
- default: 0
- example: 0
- required: false
- - name: X-Plex-Container-Size
- in: query
- description: |
- The number of items to return. If not specified, all items will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 50
- schema:
- type: integer
- format: int32
- default: 50
- example: 50
- required: false
- - name: Accept
- in: header
- required: false
- schema:
- type: string
- enum:
- - application/json
- - application/xml
- example: application/json
- responses:
- '200':
- description: The contents of the library by section and tag
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- allOf:
- - type: object
- description: |
- The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
- properties:
- Type:
- type: array
- items:
- type: object
- required:
- - key
- - type
- - title
- - active
- properties:
- key:
- type: string
- example: /library/sections/2/all?type=2
- type:
- type: string
- example: filter
- subtype:
- type: string
- example: clip
- title:
- type: string
- example: TV Shows
- active:
- type: boolean
- example: false
- Filter:
- type: array
- items:
- type: object
- required:
- - filter
- - filterType
- - key
- - title
- - type
- properties:
- filter:
- type: string
- example: genre
- filterType:
- type: string
- example: string
- key:
- type: string
- example: /library/sections/2/genre?type=2
- title:
- type: string
- example: Genre
- type:
- type: string
- example: filter
- advanced:
- type: boolean
- example: true
- Sort:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - defaultDirection
- properties:
- default:
- type: string
- example: asc
- active:
- type: boolean
- example: false
- activeDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- defaultDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- descKey:
- type: string
- example: 'titleSort:desc'
- firstCharacterKey:
- type: string
- example: /library/sections/2/firstCharacter
- key:
- type: string
- example: titleSort
- title:
- type: string
- example: Title
- Field:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - type
- properties:
- key:
- type: string
- example: show.title
- title:
- type: string
- example: Show Title
- type:
- type: string
- example: string
- subType:
- type: string
- example: rating
- FieldType:
- type: array
- items:
- type: object
- required:
- - type
- - Operator
- properties:
- type:
- type: string
- example: tag
- Operator:
- type: array
- items:
- type: object
- required:
- - key
- - title
- properties:
- key:
- type: string
- example: '='
- title:
- type: string
- example: is
- - type: object
- required:
- - size
- - totalSize
- - offset
- - content
- - allowSync
- - art
- - content
- - identifier
- - librarySectionID
- - librarySectionTitle
- - librarySectionUUID
- - mediaTagPrefix
- - mediaTagVersion
- - thumb
- - title1
- - title2
- - viewGroup
- properties:
- size:
- type: integer
- format: int32
- example: 70
- totalSize:
- type: integer
- format: int32
- example: 170
- offset:
- type: integer
- format: int32
- example: 0
- content:
- type: string
- example: secondary
- allowSync:
- type: boolean
- example: true
- nocache:
- type: boolean
- example: true
- art:
- type: string
- example: '/:/resources/movie-fanart.jpg'
- identifier:
- type: string
- example: com.plexapp.plugins.library
- librarySectionID:
- type: integer
- examples:
- - 1
- librarySectionTitle:
- type: string
- example: Movies
- librarySectionUUID:
- type: string
- example: 322a231a-b7f7-49f5-920f-14c61199cd30
- mediaTagPrefix:
- type: string
- example: /system/bundle/media/flags/
- mediaTagVersion:
- type: integer
- format: int32
- example: 1701731894
- thumb:
- type: string
- example: '/:/resources/movie.png'
- title1:
- type: string
- example: Movies
- title2:
- type: string
- example: Recently Released
- viewGroup:
- type: string
- example: movie
- viewMode:
- type: integer
- format: int32
- example: 65592
- mixedParents:
- type: boolean
- example: true
- Metadata:
- type: array
- items:
- type: object
- required:
- - ratingKey
- - key
- - guid
- - title
- - type
- - addedAt
- - summary
- properties:
- ratingKey:
- type: string
- example: '58683'
- description: |
- The rating key (Media ID) of this media item.
- Note: This is always an integer, but is represented as a string in the API.
- key:
- type: string
- example: /library/metadata/58683
- guid:
- type: string
- example: 'plex://movie/5d7768ba96b655001fdc0408'
- studio:
- type: string
- example: 20th Century Studios
- skipChildren:
- type: boolean
- example: false
- librarySectionID:
- type: integer
- examples:
- - 1
- librarySectionTitle:
- type: string
- example: Movies
- librarySectionKey:
- type: string
- example: /library/sections/1
- type:
- type: string
- enum:
- - movie
- - show
- - season
- - episode
- - artist
- - album
- example: movie
- description: |
- The type of media content
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - ARTIST
- - ALBUM
- title:
- type: string
- example: 'Avatar: The Way of Water'
- slug:
- type: string
- example: 4-for-texas
- contentRating:
- type: string
- example: PG-13
- summary:
- type: string
- example: 'Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na''vi race to protect their home.'
- rating:
- type: number
- example: 7.6
- audienceRating:
- type: number
- example: 9.2
- year:
- type: integer
- format: int32
- example: 2022
- seasonCount:
- type: integer
- format: int32
- example: 2022
- tagline:
- type: string
- example: Return to Pandora.
- flattenSeasons:
- type: string
- description: 'Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).'
- enum:
- - '-1'
- - '0'
- - '1'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - HIDE
- - SHOW
- example: '1'
- episodeSort:
- type: string
- description: 'Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).'
- enum:
- - '-1'
- - '0'
- - '1'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - OLDEST_FIRST
- - NEWEST_FIRST
- example: '0'
- enableCreditsMarkerGeneration:
- type: string
- description: 'Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).'
- enum:
- - '-1'
- - '0'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - DISABLED
- example: '-1'
- showOrdering:
- type: string
- description: |
- Setting that indicates the episode ordering for the show.
- None = Library default,
- tmdbAiring = The Movie Database (Aired),
- aired = TheTVDB (Aired),
- dvd = TheTVDB (DVD),
- absolute = TheTVDB (Absolute)).
- enum:
- - None
- - tmdbAiring
- - aired
- - dvd
- - absolute
- x-speakeasy-enums:
- - NONE
- - TMDB_AIRING
- - TVDB_AIRED
- - TVDB_DVD
- - TVDB_ABSOLUTE
- example: absolute
- thumb:
- type: string
- example: /library/metadata/58683/thumb/1703239236
- art:
- type: string
- example: /library/metadata/58683/art/1703239236
- banner:
- type: string
- example: /library/metadata/58683/banner/1703239236
- duration:
- type: integer
- format: int32
- example: 11558112
- originallyAvailableAt:
- type: string
- format: date
- example: 2022-12-14T00:00:00.000Z
- addedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- updatedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- audienceRatingImage:
- type: string
- example: 'rottentomatoes://image.rating.upright'
- chapterSource:
- type: string
- example: media
- primaryExtraKey:
- type: string
- example: /library/metadata/58684
- ratingImage:
- type: string
- example: 'rottentomatoes://image.rating.ripe'
- grandparentRatingKey:
- type: string
- example: '66'
- grandparentGuid:
- type: string
- example: 'plex://show/5d9c081b170e24001f2a7be4'
- grandparentKey:
- type: string
- example: /library/metadata/66
- grandparentTitle:
- type: string
- example: Caprica
- grandparentThumb:
- type: string
- example: /library/metadata/66/thumb/1705716261
- parentSlug:
- type: string
- example: alice-in-borderland-2020
- grandparentSlug:
- type: string
- example: alice-in-borderland-2020
- grandparentArt:
- type: string
- example: /library/metadata/66/art/1705716261
- grandparentTheme:
- type: string
- example: /library/metadata/66/theme/1705716261
- Media:
- description: |
- The Media object is only included when type query is `4` or higher.
- type: array
- items:
- type: object
- required:
- - id
- - container
- - Part
- properties:
- id:
- type: integer
- format: int32
- example: 119534
- duration:
- type: integer
- format: int32
- example: 11558112
- bitrate:
- type: integer
- format: int32
- example: 25025
- width:
- type: integer
- format: int32
- example: 3840
- height:
- type: integer
- format: int32
- example: 2072
- aspectRatio:
- type: number
- example: 1.85
- audioProfile:
- type: string
- example: dts
- audioChannels:
- type: integer
- format: int32
- example: 6
- audioCodec:
- type: string
- example: eac3
- videoCodec:
- type: string
- example: hevc
- videoResolution:
- type: string
- example: 4k
- container:
- type: string
- example: mkv
- videoFrameRate:
- type: string
- example: 24p
- videoProfile:
- type: string
- example: main 10
- hasVoiceActivity:
- type: boolean
- example: false
- optimizedForStreaming:
- allOf:
- - type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- has64bitOffsets:
- type: boolean
- example: false
- Part:
- type: array
- items:
- type: object
- required:
- - id
- - key
- - file
- - size
- - container
- properties:
- id:
- type: integer
- format: int32
- example: 119542
- key:
- type: string
- example: /library/parts/119542/1680457526/file.mkv
- duration:
- type: integer
- format: int32
- example: 11558112
- file:
- type: string
- example: /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv
- size:
- type: integer
- format: int64
- example: 36158371307
- container:
- type: string
- description: |
- The container format of the media file.
- example: mkv
- audioProfile:
- type: string
- example: dts
- has64bitOffsets:
- type: boolean
- example: false
- optimizedForStreaming:
- type: boolean
- example: false
- videoProfile:
- type: string
- example: main 10
- indexes:
- type: string
- example: sd
- hasThumbnail:
- type: string
- enum:
- - '0'
- - '1'
- example: '1'
- default: '0'
- x-speakeasy-enums:
- - false
- - true
- Stream:
- type: array
- items:
- type: object
- required:
- - id
- - streamType
- - codec
- - index
- properties:
- id:
- type: integer
- example: 272796
- streamType:
- type: integer
- description: 'Type of stream (1 = video, 2 = audio, 3 = subtitle)'
- example: 1
- default:
- type: boolean
- description: Indicates if this is the default stream
- example: true
- selected:
- type: boolean
- description: Indicates if the stream is selected
- example: true
- codec:
- type: string
- description: Codec used by the stream
- example: h264
- index:
- type: integer
- description: The index of the stream
- example: 0
- bitrate:
- type: integer
- description: The bitrate of the stream in kbps
- example: 6273
- colorPrimaries:
- type: string
- description: The color primaries of the video stream
- example: bt709
- colorRange:
- type: string
- description: The color range of the video stream
- example: tv
- colorSpace:
- type: string
- description: The color space of the video stream
- example: bt709
- colorTrc:
- type: string
- description: The transfer characteristics (TRC) of the video stream
- example: bt709
- bitDepth:
- type: integer
- description: The bit depth of the video stream
- example: 8
- chromaLocation:
- type: string
- description: The chroma location of the video stream
- example: left
- streamIdentifier:
- type: string
- description: The identifier of the video stream
- example: '2'
- chromaSubsampling:
- type: string
- description: The chroma subsampling format
- example: '4:2:0'
- codedHeight:
- type: integer
- description: The coded height of the video stream
- example: 1088
- codedWidth:
- type: integer
- description: The coded width of the video stream
- example: 1920
- frameRate:
- type: number
- description: The frame rate of the video stream
- example: 29.97
- hasScalingMatrix:
- type: boolean
- description: Indicates if the stream has a scaling matrix
- example: false
- hearingImpaired:
- type: boolean
- example: false
- closedCaptions:
- type: boolean
- example: false
- embeddedInVideo:
- type: string
- example: '1'
- height:
- type: integer
- description: The height of the video stream
- example: 1080
- level:
- type: integer
- description: The level of the video codec
- example: 40
- profile:
- type: string
- description: The profile of the video codec
- example: main
- refFrames:
- type: integer
- description: Number of reference frames
- example: 4
- scanType:
- type: string
- description: The scan type (progressive or interlaced)
- example: progressive
- width:
- type: integer
- description: The width of the video stream
- example: 1920
- displayTitle:
- type: string
- description: Display title of the stream
- example: 1080p (H.264)
- extendedDisplayTitle:
- type: string
- description: Extended display title of the stream
- example: 1080p (H.264)
- channels:
- type: integer
- description: Number of audio channels (for audio streams)
- example: 2
- language:
- type: string
- description: The language of the stream (for audio/subtitle streams)
- example: English
- languageTag:
- type: string
- description: Language tag of the stream
- example: en
- languageCode:
- type: string
- description: Language code of the stream
- example: eng
- audioChannelLayout:
- type: string
- description: The audio channel layout
- example: stereo
- samplingRate:
- type: integer
- description: Sampling rate of the audio stream in Hz
- example: 48000
- title:
- type: string
- description: Title of the subtitle track (for subtitle streams)
- example: English
- canAutoSync:
- type: boolean
- description: Indicates if the subtitle stream can auto-sync
- example: false
- Genre:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Adventure
- Country:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: United States of America
- Director:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: James Cameron
- Writer:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: James Cameron
- Collection:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Working NL Subs
- Role:
- type: array
- items:
- type: object
- properties:
- id:
- type: integer
- description: The ID of the tag or actor.
- example: 294129
- filter:
- type: string
- description: The filter used to find the actor or tag.
- example: actor=294129
- thumb:
- type: string
- description: The thumbnail of the actor
- example: 'https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg'
- tag:
- type: string
- description: The name of the tag or actor.
- example: Mike Smith
- tagKey:
- type: string
- description: Unique identifier for the tag.
- example: 668e7e7b22bcad9064350c91
- role:
- type: string
- description: The role of the actor or tag in the media.
- example: Self
- Location:
- type: array
- items:
- type: object
- properties:
- path:
- type: string
- example: /TV Shows/House
- Guid:
- x-speakeasy-name-override: MediaGuid
- description: |
- The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
- type: array
- items:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- description: |
- Can be one of the following formats:
- imdb://tt13015952, tmdb://2434012, tvdb://7945991
- example: 'imdb://tt13015952'
- UltraBlurColors:
- type: object
- required:
- - topLeft
- - topRight
- - bottomRight
- - bottomLeft
- properties:
- topLeft:
- type: string
- example: 11333b
- topRight:
- type: string
- example: 0a232d
- bottomRight:
- type: string
- example: 073958
- bottomLeft:
- type: string
- example: 1f5066
- Rating:
- x-speakeasy-name-override: MetaDataRating
- type: array
- items:
- type: object
- required:
- - image
- - value
- - type
- properties:
- image:
- type: string
- description: A URI or path to the rating image.
- example: 'themoviedb://image.rating'
- value:
- type: number
- format: float
- description: The value of the rating.
- example: 3
- type:
- type: string
- description: 'The type of rating (e.g., audience, critic).'
- example: audience
- Image:
- type: array
- items:
- type: object
- required:
- - alt
- - type
- - url
- properties:
- alt:
- type: string
- example: Episode 1
- type:
- type: string
- enum:
- - coverPoster
- - background
- - snapshot
- - clearLogo
- example: background
- url:
- type: string
- example: /library/metadata/45521/thumb/1644710589
- titleSort:
- type: string
- example: Whale
- viewCount:
- type: integer
- format: int32
- example: 1
- lastViewedAt:
- type: integer
- format: int32
- example: 1682752242
- originalTitle:
- type: string
- example: 映画 ブラッククローバー 魔法帝の剣
- viewOffset:
- type: integer
- format: int32
- example: 5222500
- skipCount:
- type: integer
- format: int32
- example: 1
- index:
- type: integer
- format: int32
- example: 1
- theme:
- type: string
- example: /library/metadata/1/theme/1705636920
- leafCount:
- type: integer
- format: int32
- example: 14
- viewedLeafCount:
- type: integer
- format: int32
- example: 0
- childCount:
- type: integer
- format: int32
- example: 1
- hasPremiumExtras:
- type: string
- example: '1'
- hasPremiumPrimaryExtra:
- type: string
- example: '1'
- parentRatingKey:
- type: string
- description: |
- The rating key of the parent item.
- example: '66'
- parentGuid:
- type: string
- example: 'plex://show/5d9c081b170e24001f2a7be4'
- parentStudio:
- type: string
- example: UCP
- parentKey:
- type: string
- example: /library/metadata/66
- parentTitle:
- type: string
- example: Caprica
- parentIndex:
- type: integer
- format: int32
- example: 1
- parentYear:
- type: integer
- format: int32
- example: 2010
- parentThumb:
- type: string
- example: /library/metadata/66/thumb/1705716261
- parentTheme:
- type: string
- example: /library/metadata/66/theme/1705716261
- Meta:
- description: |
- The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
- type: object
- properties:
- Type:
- type: array
- items:
- type: object
- required:
- - key
- - type
- - title
- - active
- properties:
- key:
- type: string
- example: /library/sections/2/all?type=2
- type:
- type: string
- example: show
- title:
- type: string
- example: TV Shows
- active:
- type: boolean
- example: false
- Filter:
- type: array
- items:
- type: object
- required:
- - filter
- - filterType
- - key
- - title
- - type
- properties:
- filter:
- type: string
- example: genre
- filterType:
- type: string
- example: string
- key:
- type: string
- example: /library/sections/2/genre?type=2
- title:
- type: string
- example: Genre
- type:
- type: string
- example: filter
- Sort:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - defaultDirection
- properties:
- default:
- type: string
- example: asc
- active:
- type: boolean
- example: false
- activeDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- defaultDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- descKey:
- type: string
- example: 'titleSort:desc'
- firstCharacterKey:
- type: string
- example: /library/sections/2/firstCharacter
- key:
- type: string
- example: titleSort
- title:
- type: string
- example: Title
- Field:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - type
- properties:
- key:
- type: string
- example: show.title
- title:
- type: string
- example: Show Title
- type:
- type: string
- example: string
- subType:
- type: string
- example: rating
- FieldType:
- type: array
- items:
- type: object
- required:
- - type
- - Operator
- properties:
- type:
- type: string
- example: tag
- Operator:
- type: array
- items:
- type: object
- required:
- - key
- - title
- properties:
- key:
- type: string
- example: '='
- title:
- type: string
- example: is
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: items
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
- $request = new Operations\GetLibraryItemsRequest(
- tag: Operations\Tag::Edition,
- type: Operations\GetLibraryItemsQueryParamType::TvShow,
- sectionKey: 9518,
- );
-
- $response = $sdk->library->getLibraryItems(
- request: $request
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: items
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetLibraryItemsRequest.new(\n tag: ::PlexRubySDK::Operations::Tag::EDITION,\n include_guids: ::PlexRubySDK::Operations::IncludeGuids::ENABLE,\n type: ::PlexRubySDK::Operations::GetLibraryItemsQueryParamType::TV_SHOW,\n section_key: 9518,\n include_meta: ::PlexRubySDK::Operations::GetLibraryItemsQueryParamIncludeMeta::ENABLE,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n)\n \nres = s.library.get_library_items(req)\n\nif ! res.object.nil?\n # handle response\nend"
- - lang: go
- label: items
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{\n Tag: operations.TagEdition,\n Type: operations.GetLibraryItemsQueryParamTypeTvShow,\n SectionKey: 9518,\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: items
- source: |-
- package hello.world;
-
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetLibraryItemsBadRequest;
- import dev.plexapi.plexapi.models.errors.GetLibraryItemsUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetLibraryItemsQueryParamType;
- import dev.plexapi.plexapi.models.operations.GetLibraryItemsRequest;
- import dev.plexapi.plexapi.models.operations.GetLibraryItemsResponse;
- import dev.plexapi.plexapi.models.operations.Tag;
- import java.lang.Exception;
-
- public class Application {
-
- public static void main(String[] args) throws GetLibraryItemsBadRequest, GetLibraryItemsUnauthorized, Exception {
-
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetLibraryItemsRequest req = GetLibraryItemsRequest.builder()
- .tag(Tag.EDITION)
- .type(GetLibraryItemsQueryParamType.TvShow)
- .sectionKey(9518)
.build();
GetLibraryItemsResponse res = sdk.library().getLibraryItems()
.request(req)
.call();
- if (res.object().isPresent()) {
+ if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
- lang: typescript
- label: items
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { GetLibraryItemsQueryParamType, Tag } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.library.getLibraryItems({
- tag: Tag.Edition,
- type: GetLibraryItemsQueryParamType.TvShow,
- sectionKey: 9518,
- });
+ const result = await plexAPI.library.getLibraryItems({});
- // Handle the result
console.log(result);
}
run();
- '/library/sections/{sectionKey}/all':
- get:
+ /library/caches:
+ delete:
+ summary: Delete library caches
+ operationId: deleteCaches
+ description: Delete the hub caches so they are recomputed on next request
tags:
- Library
- summary: Get all media of library
- operationId: get-all-media-library
- description: |
- Retrieves a list of all general media data for this library.
- parameters:
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- - name: type
- in: query
- description: |
- The type of media to retrieve or filter by.
- 1 = movie
- 2 = show
- 3 = season
- 4 = episode
- E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
- schema:
- type: integer
- enum:
- - 1
- - 2
- - 3
- - 4
- - 8
- - 9
- - 10
- example: 2
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - AUDIO
- - ALBUM
- - TRACK
- required: true
- - name: includeMeta
- in: query
- description: |
- Adds the Meta object to the response
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: includeGuids
- in: query
- description: |
- Adds the Guid object to the response
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: includeAdvanced
- in: query
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: includeCollections
- in: query
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: includeExternalMedia
- in: query
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- - name: X-Plex-Container-Start
- in: query
- description: |
- The index of the first item to return. If not specified, the first item will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 0
- schema:
- type: integer
- format: int32
- default: 0
- example: 0
- required: false
- - name: X-Plex-Container-Size
- in: query
- description: |
- The number of items to return. If not specified, all items will be returned.
- If the number of items exceeds the limit, the response will be paginated.
- By default this is 50
- schema:
- type: integer
- format: int32
- default: 50
- example: 50
- required: false
- - name: Accept
- in: header
- required: false
- schema:
- type: string
- enum:
- - application/json
- - application/xml
- example: application/json
+ security:
+ - token:
+ - admin
responses:
'200':
- description: Successful response containing media container data.
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- allOf:
- - type: object
- required:
- - size
- properties:
- size:
- description: Number of media items returned in this response.
- type: integer
- format: int32
- example: 50
- - type: object
- required:
- - totalSize
- properties:
- totalSize:
- description: Total number of media items in the library.
- type: integer
- format: int32
- example: 50
- - type: object
- required:
- - offset
- properties:
- offset:
- type: integer
- description: Offset value for pagination.
- example: 0
- - type: object
- required:
- - allowSync
- properties:
- allowSync:
- type: boolean
- description: Indicates whether syncing is allowed.
- example: false
- - type: object
- required:
- - art
- properties:
- art:
- type: string
- description: URL for the background artwork of the media container.
- example: '/:/resources/show-fanart.jpg'
- - type: object
- required:
- - content
- properties:
- content:
- type: string
- description: The content type or mode.
- example: secondary
- - type: object
- required:
- - identifier
- properties:
- identifier:
- type: string
- description: An plugin identifier for the media container.
- example: com.plexapp.plugins.library
- - type: object
- required:
- - librarySectionID
- properties:
- librarySectionID:
- type: integer
- description: The unique identifier for the library section.
- example: 2
- - type: object
- required:
- - librarySectionTitle
- properties:
- librarySectionTitle:
- type: string
- description: The title of the library section.
- example: TV Series
- - type: object
- required:
- - librarySectionTitle
- properties:
- librarySectionUUID:
- type: string
- description: The universally unique identifier for the library section.
- example: e69655a2-ef48-4aba-bb19-0cc34d1e7d36
- - type: object
- required:
- - mediaTagPrefix
- properties:
- mediaTagPrefix:
- type: string
- description: The prefix used for media tag resource paths.
- example: /system/bundle/media/flags/
- - type: object
- required:
- - mediaTagVersion
- properties:
- mediaTagVersion:
- type: integer
- description: The version number for media tags.
- example: 1734362201
- - type: object
- required:
- - thumb
- properties:
- thumb:
- type: string
- description: URL for the thumbnail image of the media container.
- example: '/:/resources/show.png'
- - type: object
- required:
- - nocache
- properties:
- nocache:
- type: boolean
- description: Specifies whether caching is disabled.
- example: true
- - type: object
- required:
- - title1
- properties:
- title1:
- type: string
- description: The primary title of the media container.
- example: TV Series
- - type: object
- required:
- - title2
- properties:
- title2:
- type: string
- description: The secondary title of the media container.
- example: By Starring Actor
- - type: object
- required:
- - viewGroup
- properties:
- viewGroup:
- type: string
- description: Identifier for the view group layout.
- example: secondary
- - type: object
- properties:
- Meta:
- type: object
- description: |
- The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
- properties:
- Type:
- type: array
- items:
- type: object
- required:
- - key
- - type
- - title
- - active
- properties:
- key:
- type: string
- example: /library/sections/2/all?type=2
- type:
- type: string
- example: filter
- subtype:
- type: string
- example: clip
- title:
- type: string
- example: TV Shows
- active:
- type: boolean
- example: false
- Filter:
- type: array
- items:
- type: object
- required:
- - filter
- - filterType
- - key
- - title
- - type
- properties:
- filter:
- type: string
- example: genre
- filterType:
- type: string
- example: string
- key:
- type: string
- example: /library/sections/2/genre?type=2
- title:
- type: string
- example: Genre
- type:
- type: string
- example: filter
- advanced:
- type: boolean
- example: true
- Sort:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - defaultDirection
- properties:
- default:
- type: string
- example: asc
- active:
- type: boolean
- example: false
- activeDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- defaultDirection:
- type: string
- enum:
- - asc
- - desc
- example: asc
- default: asc
- description: |
- The direction of the sort. Can be either `asc` or `desc`.
- x-speakeasy-enums:
- - ASCENDING
- - DESCENDING
- descKey:
- type: string
- example: 'titleSort:desc'
- firstCharacterKey:
- type: string
- example: /library/sections/2/firstCharacter
- key:
- type: string
- example: titleSort
- title:
- type: string
- example: Title
- Field:
- type: array
- items:
- type: object
- required:
- - key
- - title
- - type
- properties:
- key:
- type: string
- example: show.title
- title:
- type: string
- example: Show Title
- type:
- type: string
- example: string
- subType:
- type: string
- example: rating
- FieldType:
- type: array
- items:
- type: object
- required:
- - type
- - Operator
- properties:
- type:
- type: string
- example: tag
- Operator:
- type: array
- items:
- type: object
- required:
- - key
- - title
- properties:
- key:
- type: string
- example: '='
- title:
- type: string
- example: is
- Metadata:
- type: array
- description: An array of metadata items.
- items:
- required:
- - type
- allOf:
- - type: object
- required:
- - ratingKey
- properties:
- ratingKey:
- type: string
- description: 'The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API.'
- example: '58683'
- - type: object
- required:
- - key
- properties:
- key:
- type: string
- description: The unique key for the media item.
- example: /library/metadata/58683
- - type: object
- required:
- - guid
- properties:
- guid:
- type: string
- description: The globally unique identifier for the media item.
- example: 'plex://movie/5d7768ba96b655001fdc0408'
- - type: object
- required:
- - slug
- properties:
- slug:
- type: string
- description: A URL‐friendly version of the media title.
- example: 4-for-texas
- - type: object
- properties:
- studio:
- type: string
- description: The studio that produced the media item.
- example: 20th Century Studios
- - type: object
- required:
- - type
- properties:
- type:
- allOf:
- - type: string
- enum:
- - movie
- - show
- - season
- - episode
- - artist
- - album
- example: movie
- description: |
- The type of media content
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - ARTIST
- - ALBUM
- - type: object
- required:
- - title
- properties:
- title:
- type: string
- description: The title of the media item.
- example: 'Avatar: The Way of Water'
- - type: object
- required:
- - titleSort
- properties:
- titleSort:
- type: string
- description: The sort title used for ordering media items.
- example: Whale
- - type: object
- properties:
- contentRating:
- type: string
- description: The content rating for the media item.
- example: PG-13
- - type: object
- required:
- - summary
- properties:
- summary:
- type: string
- description: A synopsis of the media item.
- example: |
- Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.
- Once a familiar threat returns to finish what was previously started, Jake must
- work with Neytiri and the army of the Na'vi race to protect their home.
- - type: object
- required:
- - rating
- properties:
- rating:
- type: number
- format: float
- description: The critic rating for the media item.
- example: 7.6
- - type: object
- required:
- - audienceRating
- properties:
- audienceRating:
- type: number
- description: The audience rating for the media item.
- example: 9.2
- - type: object
- required:
- - year
- properties:
- year:
- type: integer
- format: int32
- description: The release year of the media item.
- example: 2022
- - type: object
- required:
- - tagline
- properties:
- tagline:
- type: string
- description: A brief tagline for the media item.
- example: Return to Pandora.
- - type: object
- required:
- - thumb
- properties:
- thumb:
- type: string
- description: The thumbnail image URL for the media item.
- example: /library/metadata/58683/thumb/1703239236
- - type: object
- required:
- - art
- properties:
- art:
- type: string
- description: The art image URL for the media item.
- example: /library/metadata/58683/art/1703239236
- - type: object
- required:
- - theme
- properties:
- theme:
- type: string
- description: The theme URL for the media item.
- example: /library/metadata/1/theme/1705636920
- - type: object
- required:
- - index
- properties:
- index:
- type: integer
- format: int32
- description: The index position of the media item.
- example: 1
- - type: object
- properties:
- leafCount:
- type: integer
- format: int32
- description: The number of leaf items (end nodes) under this media item.
- example: 14
- - type: object
- properties:
- viewedLeafCount:
- type: integer
- format: int32
- description: The number of leaf items that have been viewed.
- example: 0
- - type: object
- required:
- - childCount
- properties:
- childCount:
- type: integer
- format: int32
- description: The number of child items associated with this media item.
- example: 1
- - type: object
- required:
- - seasonCount
- properties:
- seasonCount:
- type: integer
- format: int32
- description: The total number of seasons (for TV shows).
- example: 2022
- - type: object
- required:
- - duration
- properties:
- duration:
- type: integer
- format: int32
- description: The duration of the media item in milliseconds.
- example: 11558112
- - type: object
- required:
- - originallyAvailableAt
- properties:
- originallyAvailableAt:
- type: string
- format: date
- description: The original release date of the media item.
- example: '2022-12-14'
- - type: object
- required:
- - addedAt
- properties:
- addedAt:
- allOf:
- - description: Unix timestamp when the item was added.
- - type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- - type: object
- properties:
- updatedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- - type: object
- properties:
- audienceRatingImage:
- type: string
- description: The URL for the audience rating image.
- example: 'rottentomatoes://image.rating.upright'
- - type: object
- properties:
- chapterSource:
- type: string
- description: The source from which chapter data is derived.
- example: media
- - type: object
- properties:
- primaryExtraKey:
- type: string
- description: The primary extra key associated with this media item.
- example: /library/metadata/58684
- - type: object
- properties:
- originalTitle:
- type: string
- description: The original title of the media item (if different).
- example: 映画 ブラッククローバー 魔法帝の剣
- - type: object
- properties:
- parentRatingKey:
- type: string
- description: The rating key of the parent media item.
- example: '66'
- - type: object
- properties:
- grandparentRatingKey:
- type: string
- description: The rating key of the grandparent media item.
- example: '66'
- - type: object
- properties:
- parentGuid:
- type: string
- description: The GUID of the parent media item.
- example: 'plex://show/5d9c081b170e24001f2a7be4'
- - type: object
- properties:
- grandparentGuid:
- type: string
- description: The GUID of the grandparent media item.
- example: 'plex://show/5d9c081b170e24001f2a7be4'
- - type: object
- properties:
- grandparentSlug:
- type: string
- description: The slug for the grandparent media item.
- example: alice-in-borderland-2020
- - type: object
- properties:
- grandparentKey:
- type: string
- description: The key of the grandparent media item.
- example: /library/metadata/66
- - type: object
- properties:
- parentKey:
- type: string
- description: The key of the parent media item.
- example: /library/metadata/66
- - type: object
- properties:
- grandparentTitle:
- type: string
- description: The title of the grandparent media item.
- example: Caprica
- - type: object
- properties:
- grandparentThumb:
- type: string
- description: The thumbnail URL for the grandparent media item.
- example: /library/metadata/66/thumb/1705716261
- - type: object
- properties:
- grandparentTheme:
- type: string
- description: The theme URL for the grandparent media item.
- example: /library/metadata/66/theme/1705716261
- - type: object
- properties:
- grandparentArt:
- type: string
- description: The art URL for the grandparent media item.
- example: /library/metadata/66/art/1705716261
- - type: object
- properties:
- parentTitle:
- type: string
- description: The title of the parent media item.
- example: Caprica
- - type: object
- properties:
- parentIndex:
- type: integer
- format: int32
- description: The index position of the parent media item.
- example: 1
- - type: object
- properties:
- parentThumb:
- type: string
- description: The thumbnail URL for the parent media item.
- example: /library/metadata/66/thumb/1705716261
- - type: object
- properties:
- ratingImage:
- type: string
- description: The URL for the rating image.
- example: 'rottentomatoes://image.rating.ripe'
- - type: object
- properties:
- viewCount:
- type: integer
- format: int32
- description: The number of times this media item has been viewed.
- example: 1
- - type: object
- properties:
- viewOffset:
- type: integer
- format: int32
- description: The current playback offset (in milliseconds).
- example: 5222500
- - type: object
- properties:
- skipCount:
- type: integer
- format: int32
- description: The number of times this media item has been skipped.
- example: 1
- - type: object
- properties:
- subtype:
- type: string
- description: 'A classification that further describes the type of media item. For example, ''clip'' indicates that the item is a short video clip.'
- example: clip
- - type: object
- properties:
- lastRatedAt:
- type: integer
- format: int64
- description: The Unix timestamp representing the last time the item was rated.
- example: 1721813113
- - type: object
- properties:
- createdAtAccuracy:
- type: string
- description: 'The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, ''epoch,local'' means both epoch and local time formats are available).'
- example: 'epoch,local'
- - type: object
- properties:
- createdAtTZOffset:
- type: string
- description: 'The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC.'
- example: '0'
- - type: object
- properties:
- lastViewedAt:
- type: integer
- format: int32
- description: Unix timestamp for when the media item was last viewed.
- example: 1682752242
- - type: object
- properties:
- userRating:
- type: number
- format: float
- description: The rating provided by a user for the item. This value is expressed as a decimal number.
- example: 10
- - type: object
- description: |
- The available images for this media item
- properties:
- Image:
- type: array
- items:
- type: object
- required:
- - alt
- - type
- - url
- properties:
- alt:
- type: string
- example: Episode 1
- type:
- type: string
- enum:
- - coverPoster
- - background
- - snapshot
- - clearLogo
- example: background
- url:
- type: string
- example: /library/metadata/45521/thumb/1644710589
- - type: object
- description: |
- Unknown
- properties:
- UltraBlurColors:
- type: object
- required:
- - topLeft
- - topRight
- - bottomRight
- - bottomLeft
- properties:
- topLeft:
- type: string
- example: 11333b
- topRight:
- type: string
- example: 0a232d
- bottomRight:
- type: string
- example: 073958
- bottomLeft:
- type: string
- example: 1f5066
- - type: object
- properties:
- Media:
- allOf:
- - type: array
- description: An array of media file data items.
- items:
- type: object
- required:
- - id
- - hasVoiceActivity
- - Part
- properties:
- id:
- type: integer
- description: Unique media identifier.
- example: 387322
- duration:
- type: integer
- format: int32
- description: Duration of the media in milliseconds.
- example: 9610350
- bitrate:
- type: integer
- format: int32
- description: Bitrate in bits per second.
- example: 25512
- width:
- type: integer
- description: Video width in pixels.
- example: 3840
- format: int32
- height:
- type: integer
- description: Video height in pixels.
- example: 1602
- format: int32
- aspectRatio:
- type: number
- format: float
- description: Aspect ratio of the video.
- example: 2.35
- audioChannels:
- type: integer
- description: Number of audio channels.
- example: 6
- format: int32
- displayOffset:
- type: integer
- format: int32
- example: 50
- audioCodec:
- type: string
- description: Audio codec used.
- example: eac3
- videoCodec:
- type: string
- description: Video codec used.
- example: hevc
- videoResolution:
- type: string
- description: 'Video resolution (e.g., 4k).'
- example: 4k
- container:
- type: string
- description: File container type.
- example: mkv
- videoFrameRate:
- type: string
- description: |
- Frame rate of the video. Values found include NTSC, PAL, 24p
- example: 24p
- videoProfile:
- type: string
- description: 'Video profile (e.g., main 10).'
- example: main 10
- hasVoiceActivity:
- type: boolean
- description: Indicates whether voice activity is detected.
- example: false
- audioProfile:
- type: string
- description: 'The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).'
- example: dts
- optimizedForStreaming:
- description: 'Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true'
- oneOf:
- - type: integer
- format: int32
- enum:
- - 0
- - 1
- - type: boolean
- enum:
- - true
- - false
- has64bitOffsets:
- type: boolean
- example: false
- Part:
- type: array
- description: An array of parts for this media item.
- items:
- type: object
- required:
- - id
- - key
- - file
- - size
- properties:
- accessible:
- type: boolean
- description: Indicates if the part is accessible.
- example: true
- exists:
- type: boolean
- description: Indicates if the part exists.
- example: true
- id:
- type: integer
- description: Unique part identifier.
- example: 418385
- key:
- type: string
- description: Key to access this part.
- example: /library/parts/418385/1735864239/file.mkv
- indexes:
- type: string
- example: sd
- duration:
- type: integer
- format: int32
- description: Duration of the part in milliseconds.
- example: 9610350
- file:
- type: string
- description: File path for the part.
- example: /mnt/Movies_1/W/Wicked (2024).mkv
- size:
- description: File size in bytes.
- type: integer
- example: 30649952104
- packetLength:
- type: integer
- format: int32
- example: 188
- container:
- type: string
- description: Container format of the part.
- example: mkv
- videoProfile:
- type: string
- description: Video profile for the part.
- example: main 10
- audioProfile:
- type: string
- description: 'The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).'
- example: dts
- has64bitOffsets:
- type: boolean
- example: false
- optimizedForStreaming:
- description: 'Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true'
- oneOf:
- - type: integer
- format: int32
- enum:
- - 0
- - 1
- - type: boolean
- enum:
- - true
- - false
- hasThumbnail:
- allOf:
- - description: Indicates if the part has a thumbnail.
- - type: string
- enum:
- - '0'
- - '1'
- example: '1'
- default: '0'
- x-speakeasy-enums:
- - false
- - true
- Stream:
- type: array
- description: An array of streams for this part.
- items:
- type: object
- required:
- - id
- - streamType
- - codec
- - index
- - language
- - languageTag
- - languageCode
- - displayTitle
- - extendedDisplayTitle
- properties:
- id:
- type: integer
- description: Unique stream identifier.
- example: 1002625
- streamType:
- type: integer
- format: int32
- description: 'Stream type (1=video, 2=audio, 3=subtitle).'
- example: 1
- default:
- type: boolean
- description: Indicates if this stream is default.
- example: true
- codec:
- type: string
- description: Codec used by the stream.
- example: hevc
- index:
- type: integer
- format: int32
- description: Index of the stream.
- example: 0
- bitrate:
- type: integer
- format: int32
- description: Bitrate of the stream.
- example: 24743
- language:
- type: string
- description: Language of the stream.
- example: English
- languageTag:
- type: string
- description: 'Language tag (e.g., en).'
- example: en
- languageCode:
- type: string
- description: ISO language code.
- example: eng
- headerCompression:
- type: boolean
- description: Indicates whether header compression is enabled.
- example: true
- DOVIBLCompatID:
- type: integer
- format: int32
- description: Dolby Vision BL compatibility ID.
- example: 1
- DOVIBLPresent:
- type: boolean
- description: Indicates if Dolby Vision BL is present.
- example: true
- DOVIELPresent:
- type: boolean
- description: Indicates if Dolby Vision EL is present.
- example: false
- DOVILevel:
- type: integer
- format: int32
- description: Dolby Vision level.
- example: 6
- DOVIPresent:
- type: boolean
- description: Indicates if Dolby Vision is present.
- example: true
- DOVIProfile:
- type: integer
- format: int32
- description: Dolby Vision profile.
- example: 8
- DOVIRPUPresent:
- type: boolean
- description: Indicates if Dolby Vision RPU is present.
- example: true
- DOVIVersion:
- type: string
- description: Dolby Vision version.
- example: '1.0'
- bitDepth:
- type: integer
- format: int32
- description: Bit depth of the video stream.
- example: 10
- chromaLocation:
- type: string
- description: Chroma sample location.
- example: topleft
- chromaSubsampling:
- type: string
- description: Chroma subsampling format.
- example: '4:2:0'
- codedHeight:
- type: integer
- format: int32
- description: Coded video height.
- example: 1608
- codedWidth:
- type: integer
- format: int32
- description: Coded video width.
- example: 3840
- colorPrimaries:
- type: string
- description: Color primaries used.
- example: bt2020
- colorRange:
- type: string
- description: 'Color range (e.g., tv).'
- example: tv
- colorSpace:
- type: string
- description: Color space.
- example: bt2020nc
- colorTrc:
- type: string
- description: Color transfer characteristics.
- example: smpte2084
- frameRate:
- type: number
- format: float
- description: Frame rate of the stream.
- example: 23.976
- height:
- type: integer
- format: int32
- description: Height of the video stream.
- example: 1602
- level:
- type: integer
- format: int32
- description: Video level.
- example: 150
- original:
- type: boolean
- description: Indicates if this is the original stream.
- example: true
- hasScalingMatrix:
- type: boolean
- example: false
- profile:
- type: string
- description: Video profile.
- example: main 10
- scanType:
- type: string
- example: progressive
- refFrames:
- type: integer
- format: int32
- description: Number of reference frames.
- example: 1
- width:
- type: integer
- format: int32
- description: Width of the video stream.
- example: 3840
- displayTitle:
- type: string
- description: Display title for the stream.
- example: 4K DoVi/HDR10 (HEVC Main 10)
- extendedDisplayTitle:
- type: string
- description: Extended display title for the stream.
- example: 4K DoVi/HDR10 (HEVC Main 10)
- selected:
- type: boolean
- description: Indicates if this stream is selected (applicable for audio streams).
- example: true
- forced:
- type: boolean
- example: true
- channels:
- type: integer
- format: int32
- description: Number of audio channels (for audio streams).
- example: 6
- audioChannelLayout:
- type: string
- description: Audio channel layout.
- example: 5.1(side)
- samplingRate:
- type: integer
- format: int32
- description: Sampling rate for the audio stream.
- example: 48000
- canAutoSync:
- type: boolean
- description: Indicates if the stream can auto-sync.
- example: false
- hearingImpaired:
- type: boolean
- description: Indicates if the stream is for the hearing impaired.
- example: true
- dub:
- type: boolean
- description: Indicates if the stream is a dub.
- example: true
- title:
- type: string
- description: 'Optional title for the stream (e.g., language variant).'
- example: SDH
- Genre:
- type: array
- items:
- allOf:
- - type: object
- required:
- - tag
- properties:
- tag:
- type: string
- description: The country of origin of this media item
- example: United States of America
- Country:
- type: array
- items:
- allOf:
- - type: object
- required:
- - tag
- properties:
- tag:
- type: string
- description: The country of origin of this media item
- example: United States of America
- Director:
- type: array
- items:
- allOf:
- - type: object
- required:
- - tag
- properties:
- tag:
- type: string
- description: The role of Director
- example: Danny Boyle
- Writer:
- type: array
- items:
- allOf:
- - type: object
- required:
- - tag
- properties:
- tag:
- type: string
- description: The role of Writer
- example: Danny Boyle
- Role:
- type: array
- items:
- allOf:
- - type: object
- required:
- - tag
- properties:
- tag:
- type: string
- description: The name of the actor for this role
- example: Danny Boyle
- Guid:
- x-speakeasy-name-override: guids
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- description: |
- The unique identifier for the Guid. Can be imdb://tt0286347, tmdb://1763, tvdb://2337
- example: 'tvdb://2337'
- Collection:
- type: array
- items:
- allOf:
- - type: object
- required:
- - tag
- properties:
- tag:
- type: string
- description: The user-made collection this media item belongs to
- example: My Awesome Collection
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- '404':
- description: Not Found - Returned if the resource could not be found
- content:
- text/html:
- example: |
-
-
-
- Not Found
-
-
- 404 Not Found
-
-
+ $ref: '#/components/responses/200'
x-codeSamples:
- - lang: php
- label: library
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
- $request = new Operations\GetAllMediaLibraryRequest(
- sectionKey: 9518,
- type: Operations\GetAllMediaLibraryQueryParamType::TvShow,
- );
-
- $response = $sdk->library->getAllMediaLibrary(
- request: $request
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: library
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetAllMediaLibraryRequest.new(\n section_key: 9518,\n type: ::PlexRubySDK::Operations::GetAllMediaLibraryQueryParamType::TV_SHOW,\n include_meta: ::PlexRubySDK::Operations::GetAllMediaLibraryQueryParamIncludeMeta::ENABLE,\n include_guids: ::PlexRubySDK::Operations::QueryParamIncludeGuids::ENABLE,\n include_advanced: ::PlexRubySDK::Operations::IncludeAdvanced::ENABLE,\n include_collections: ::PlexRubySDK::Operations::QueryParamIncludeCollections::ENABLE,\n include_external_media: ::PlexRubySDK::Operations::QueryParamIncludeExternalMedia::ENABLE,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n)\n \nres = s.library.get_all_media_library(req)\n\nif ! res.object.nil?\n # handle response\nend"
- lang: go
- label: library
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetAllMediaLibrary(ctx, operations.GetAllMediaLibraryRequest{\n SectionKey: 9518,\n Type: operations.GetAllMediaLibraryQueryParamTypeTvShow,\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- - lang: java
- label: library
+ label: PlexGO
source: |-
- package hello.world;
+ package main
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetAllMediaLibraryBadRequest;
- import dev.plexapi.plexapi.models.errors.GetAllMediaLibraryUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetAllMediaLibraryQueryParamType;
- import dev.plexapi.plexapi.models.operations.GetAllMediaLibraryRequest;
- import dev.plexapi.plexapi.models.operations.GetAllMediaLibraryResponse;
- import java.lang.Exception;
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
- public class Application {
+ func main() {
+ ctx := context.Background()
- public static void main(String[] args) throws GetAllMediaLibraryBadRequest, GetAllMediaLibraryUnauthorized, Exception {
+ s := plexgo.New(
+ plexgo.WithSecurity(""),
+ )
- PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
- .build();
-
- GetAllMediaLibraryRequest req = GetAllMediaLibraryRequest.builder()
- .sectionKey(9518)
- .type(GetAllMediaLibraryQueryParamType.TvShow)
- .build();
-
- GetAllMediaLibraryResponse res = sdk.library().getAllMediaLibrary()
- .request(req)
- .call();
-
- if (res.object().isPresent()) {
- // handle response
- }
+ res, err := s.Library.DeleteCaches(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
}
}
- - lang: typescript
- label: library
- source: |-
- import { PlexAPI } from "@lukehagar/plexjs";
- import { GetAllMediaLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
-
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
-
- async function run() {
- const result = await plexAPI.library.getAllMediaLibrary({
- sectionKey: 9518,
- type: GetAllMediaLibraryQueryParamType.TvShow,
- });
-
- // Handle the result
- console.log(result);
- }
-
- run();
- '/library/sections/{sectionKey}/refresh':
- get:
- tags:
- - Library
- summary: Refresh Metadata Of The Library
- description: |
- This endpoint Refreshes all the Metadata of the library.
- operationId: get-refresh-library-metadata
- parameters:
- - name: force
- description: Force the refresh even if the library is already being refreshed.
- in: query
- schema:
- type: integer
- example: 0
- enum:
- - 0
- - 1
- required: false
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- responses:
- '200':
- description: The library is refreshing
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- x-codeSamples:
- - lang: php
- label: metadata
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->getRefreshLibraryMetadata(
- sectionKey: 9518,
- force: Operations\Force::One
-
- );
-
- if ($response->statusCode === 200) {
- // handle response
- }
- - lang: ruby
- label: metadata
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_refresh_library_metadata(section_key=9518, force=::PlexRubySDK::Operations::Force::ONE)\n\nif res.status_code == 200\n # handle response\nend"
- - lang: go
- label: metadata
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetRefreshLibraryMetadata(ctx, 9518, operations.ForceOne.ToPointer())\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- lang: java
- label: metadata
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataBadRequest;
- import dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataUnauthorized;
- import dev.plexapi.plexapi.models.operations.Force;
- import dev.plexapi.plexapi.models.operations.GetRefreshLibraryMetadataResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.DeleteCachesResponse;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetRefreshLibraryMetadataBadRequest, GetRefreshLibraryMetadataUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata()
- .force(Force.ONE)
- .sectionKey(9518)
+ DeleteCachesResponse res = sdk.library().deleteCaches()
.call();
// handle response
}
}
- lang: typescript
- label: metadata
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { Force } from "@lukehagar/plexjs/sdk/models/operations";
- const plexAPI = new PlexAPI({
- accessToken: "",
- });
+ const plexAPI = new PlexAPI();
async function run() {
- const result = await plexAPI.library.getRefreshLibraryMetadata(9518, Force.One);
+ const result = await plexAPI.library.deleteCaches();
- // Handle the result
console.log(result);
}
run();
- '/library/sections/{sectionKey}/search':
- get:
+ /library/clean/bundles:
+ put:
+ summary: Clean bundles
+ operationId: cleanBundles
+ description: Clean out any now unused bundles. Bundles can become unused when media is deleted
tags:
- Library
- summary: Search Library
- operationId: get-search-library
- description: "Search for content within a specific section of the library.\n\n### Types\nEach type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:\n\n- **Type Object Attributes**:\n - `type`: Metadata type (if standard Plex type). \n - `title`: Title for this content type (e.g., \"Movies\").\n\n- **Filter Objects**:\n - Subset of the media query language.\n - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.\n\n- **Sort Objects**:\n - Description of sort fields.\n - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.\n\n> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.\n"
- parameters:
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- - name: Accept
- in: header
- required: false
- schema:
- type: string
- enum:
- - application/json
- - application/xml
- example: application/json
- - name: type
- in: query
- description: |
- The type of media to retrieve or filter by.
- 1 = movie
- 2 = show
- 3 = season
- 4 = episode
- E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
- schema:
- type: integer
- enum:
- - 1
- - 2
- - 3
- - 4
- - 8
- - 9
- - 10
- example: 2
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - AUDIO
- - ALBUM
- - TRACK
- required: true
+ security:
+ - token:
+ - admin
responses:
'200':
- description: The contents of the library by section and type
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- type: object
- properties:
- size:
- type: integer
- format: int32
- example: 2
- allowSync:
- type: boolean
- example: false
- art:
- type: string
- example: '/:/resources/show-fanart.jpg'
- identifier:
- type: string
- example: com.plexapp.plugins.library
- mediaTagPrefix:
- type: string
- example: /system/bundle/media/flags/
- mediaTagVersion:
- type: integer
- format: int32
- example: 1698860922
- nocache:
- type: boolean
- example: true
- thumb:
- type: string
- example: '/:/resources/show.png'
- title1:
- type: string
- example: TV Shows
- title2:
- type: string
- example: Search for ''
- viewGroup:
- type: string
- example: season
- viewMode:
- type: integer
- format: int32
- example: 65593
- Metadata:
- type: array
- items:
- type: object
- properties:
- ratingKey:
- type: string
- example: '2'
- key:
- type: string
- example: /library/metadata/2/children
- parentRatingKey:
- type: string
- example: '1'
- guid:
- type: string
- example: 'plex://season/602e67e766dfdb002c0a1b5b'
- parentGuid:
- type: string
- example: 'plex://show/5d9c086c7d06d9001ffd27aa'
- parentStudio:
- type: string
- example: Mutant Enemy Productions
- type:
- type: string
- example: season
- title:
- type: string
- example: Season 1
- parentKey:
- type: string
- example: /library/metadata/1
- parentTitle:
- type: string
- example: Firefly
- summary:
- type: string
- example: 'Captain Malcolm ''Mal'' Reynolds is a former galactic war veteran who is the captain of the transport ship "Serenity". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe''s husband, pilot Hoban ''Wash'' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government "The Alliance"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space.'
- index:
- type: integer
- format: int32
- example: 1
- parentIndex:
- type: integer
- format: int32
- example: 1
- parentYear:
- type: integer
- format: int32
- example: 2002
- thumb:
- type: string
- example: /library/metadata/2/thumb/1705636920
- art:
- type: string
- example: /library/metadata/1/art/1705636920
- parentThumb:
- type: string
- example: /library/metadata/1/thumb/1705636920
- parentTheme:
- type: string
- example: /library/metadata/1/theme/1705636920
- addedAt:
- type: integer
- format: int32
- example: 1705636916
- updatedAt:
- type: integer
- format: int32
- example: 1705636920
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ $ref: '#/components/responses/200'
x-codeSamples:
- - lang: php
- label: library
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->getSearchLibrary(
- sectionKey: 9518,
- type: Operations\GetSearchLibraryQueryParamType::TvShow
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: library
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_search_library(section_key=9518, type=::PlexRubySDK::Operations::GetSearchLibraryQueryParamType::TV_SHOW)\n\nif ! res.object.nil?\n # handle response\nend"
- lang: go
- label: library
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetSearchLibrary(ctx, 9518, operations.GetSearchLibraryQueryParamTypeTvShow)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Library.CleanBundles(ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
+ }
+ }
- lang: java
- label: library
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetSearchLibraryBadRequest;
- import dev.plexapi.plexapi.models.errors.GetSearchLibraryUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetSearchLibraryQueryParamType;
- import dev.plexapi.plexapi.models.operations.GetSearchLibraryResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.CleanBundlesResponse;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetSearchLibraryBadRequest, GetSearchLibraryUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetSearchLibraryResponse res = sdk.library().getSearchLibrary()
- .sectionKey(9518)
- .type(GetSearchLibraryQueryParamType.TvShow)
+ CleanBundlesResponse res = sdk.library().cleanBundles()
.call();
- if (res.object().isPresent()) {
+ // handle response
+ }
+ }
+ - lang: typescript
+ label: PlexJS
+ source: |-
+ import { PlexAPI } from "@lukehagar/plexjs";
+
+ const plexAPI = new PlexAPI();
+
+ async function run() {
+ const result = await plexAPI.library.cleanBundles();
+
+ console.log(result);
+ }
+
+ run();
+ /library/collections:
+ post:
+ summary: Create collection
+ operationId: createCollection
+ description: Create a collection in the library
+ tags:
+ - Collections
+ parameters:
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: sectionId
+ description: The section where this collection will be created
+ in: query
+ required: true
+ schema:
+ type: string
+ - $ref: '#/components/parameters/title'
+ - $ref: '#/components/parameters/smart'
+ - name: uri
+ description: The URI for processing the smart collection. Required for a smart collection
+ in: query
+ schema:
+ type: string
+ - $ref: '#/components/parameters/type'
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/MediaContainerWithMetadata'
+ '400':
+ description: The uri is missing for a smart collection or the section could not be found
+ content:
+ text/html: {}
+ x-codeSamples:
+ - lang: go
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Collections.CreateCollection(ctx, operations.CreateCollectionRequest{
+ SectionID: "",
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.MediaContainerWithMetadata != nil {
+ // handle response
+ }
+ }
+ - lang: java
+ label: PlexJava
+ source: |-
+ package hello.world;
+
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.CreateCollectionRequest;
+ import dev.plexapi.sdk.models.operations.CreateCollectionResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import java.lang.Exception;
+
+ public class Application {
+
+ public static void main(String[] args) throws Exception {
+
+ PlexAPI sdk = PlexAPI.builder()
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
+ .build();
+
+ CreateCollectionRequest req = CreateCollectionRequest.builder()
+ .sectionId("")
+ .build();
+
+ CreateCollectionResponse res = sdk.collections().createCollection()
+ .request(req)
+ .call();
+
+ if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
- lang: typescript
- label: library
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.library.getSearchLibrary(9518, GetSearchLibraryQueryParamType.TvShow);
+ const result = await plexAPI.collections.createCollection({
+ sectionId: "",
+ });
- // Handle the result
console.log(result);
}
run();
- '/library/sections/{sectionKey}/genre':
- get:
+ /library/file:
+ post:
+ summary: Ingest a transient item
+ operationId: ingestTransientItem
+ description: |-
+ This endpoint takes a file path specified in the `url` parameter, matches it using the scanner's match mechanism, downloads rich metadata, and then ingests the item as a transient item (without a library section). In the case where the file represents an episode, the entire tree (show, season, and episode) is added as transient items. At this time, movies and episodes are the only supported types, which are gleaned automatically from the file path.
+ Note that any of the parameters passed to the metadata details endpoint (e.g. `includeExtras=1`) work here.
tags:
- Library
- summary: Get Genres of library media
- operationId: get-genres-library
- description: |
- Retrieves a list of all the genres that are found for the media in this library.
parameters:
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- - name: type
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: url
+ description: The file of the file to ingest.
in: query
- description: |
- The type of media to retrieve or filter by.
- 1 = movie
- 2 = show
- 3 = season
- 4 = episode
- E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
- schema:
- type: integer
- enum:
- - 1
- - 2
- - 3
- - 4
- - 8
- - 9
- - 10
- example: 2
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - AUDIO
- - ALBUM
- - TRACK
- required: true
- - name: Accept
- in: header
- required: false
schema:
type: string
- enum:
- - application/json
- - application/xml
- example: application/json
+ format: url
+ example: file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv
+ - name: virtualFilePath
+ description: A virtual path to use when the url is opaque.
+ in: query
+ schema:
+ type: string
+ example: /Avatar.mkv
+ - name: computeHashes
+ description: Whether or not to compute Plex and OpenSubtitle hashes for the file. Defaults to 0.
+ in: query
+ schema:
+ $ref: "#/components/schemas/BoolInt"
+ example: 1
+ - name: ingestNonMatches
+ description: Whether or not non matching media should be stored. Defaults to 0.
+ in: query
+ schema:
+ $ref: "#/components/schemas/BoolInt"
+ example: 1
responses:
'200':
- description: Successful response containing media container data.
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ description: Provided on all MediaContainer objects indicating the offset of where this container page starts
+ schema:
+ type: integer
+ X-Plex-Container-Total-Size:
+ description: Provided on all MediaContainer objects indicating the total size of objects available
+ schema:
+ type: integer
content:
application/json:
schema:
- type: object
- properties:
- MediaContainer:
- allOf:
- - type: object
- required:
- - size
- properties:
- size:
- description: Number of media items returned in this response.
- type: integer
- format: int32
- example: 50
- - type: object
- required:
- - allowSync
- properties:
- allowSync:
- type: boolean
- description: Indicates whether syncing is allowed.
- example: false
- - type: object
- required:
- - art
- properties:
- art:
- type: string
- description: URL for the background artwork of the media container.
- example: '/:/resources/show-fanart.jpg'
- - type: object
- required:
- - content
- properties:
- content:
- type: string
- description: The content type or mode.
- example: secondary
- - type: object
- required:
- - identifier
- properties:
- identifier:
- type: string
- description: An plugin identifier for the media container.
- example: com.plexapp.plugins.library
- - type: object
- required:
- - mediaTagPrefix
- properties:
- mediaTagPrefix:
- type: string
- description: The prefix used for media tag resource paths.
- example: /system/bundle/media/flags/
- - type: object
- required:
- - mediaTagVersion
- properties:
- mediaTagVersion:
- type: integer
- description: The version number for media tags.
- example: 1734362201
- - type: object
- required:
- - nocache
- properties:
- nocache:
- type: boolean
- description: Specifies whether caching is disabled.
- example: true
- - type: object
- required:
- - thumb
- properties:
- thumb:
- type: string
- description: URL for the thumbnail image of the media container.
- example: '/:/resources/show.png'
- - type: object
- required:
- - title1
- properties:
- title1:
- type: string
- description: The primary title of the media container.
- example: TV Series
- - type: object
- required:
- - title2
- properties:
- title2:
- type: string
- description: The secondary title of the media container.
- example: By Starring Actor
- - type: object
- required:
- - viewGroup
- properties:
- viewGroup:
- type: string
- description: Identifier for the view group layout.
- example: secondary
- - type: object
- properties:
- Directory:
- type: array
- items:
- type: object
- required:
- - fastKey
- - key
- - title
- - type
- properties:
- fastKey:
- type: string
- example: /library/sections/10/all?genre=89
- key:
- type: string
- example: '89'
- title:
- type: string
- example: Action
- type:
- type: string
- example: genre
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- '404':
- description: Not Found - Returned if the resource could not be found
- content:
- text/html:
- example: |
-
-
-
- Not Found
-
-
- 404 Not Found
-
-
+ $ref: '#/components/schemas/MediaContainerWithMetadata'
x-codeSamples:
- - lang: php
- label: library
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->getGenresLibrary(
- sectionKey: 9518,
- type: Operations\GetGenresLibraryQueryParamType::TvShow
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: library
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_genres_library(section_key=9518, type=::PlexRubySDK::Operations::GetGenresLibraryQueryParamType::TV_SHOW)\n\nif ! res.object.nil?\n # handle response\nend"
- lang: go
- label: library
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetGenresLibrary(ctx, 9518, operations.GetGenresLibraryQueryParamTypeTvShow)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Library.IngestTransientItem(ctx, operations.IngestTransientItemRequest{
+ URL: plexgo.Pointer("file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv"),
+ VirtualFilePath: plexgo.Pointer("/Avatar.mkv"),
+ ComputeHashes: components.BoolIntOne.ToPointer(),
+ IngestNonMatches: components.BoolIntOne.ToPointer(),
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.MediaContainerWithMetadata != nil {
+ // handle response
+ }
+ }
- lang: java
- label: library
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetGenresLibraryBadRequest;
- import dev.plexapi.plexapi.models.errors.GetGenresLibraryUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetGenresLibraryQueryParamType;
- import dev.plexapi.plexapi.models.operations.GetGenresLibraryResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.IngestTransientItemRequest;
+ import dev.plexapi.sdk.models.operations.IngestTransientItemResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetGenresLibraryBadRequest, GetGenresLibraryUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetGenresLibraryResponse res = sdk.library().getGenresLibrary()
- .sectionKey(9518)
- .type(GetGenresLibraryQueryParamType.TvShow)
+ IngestTransientItemRequest req = IngestTransientItemRequest.builder()
+ .url("file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv")
+ .virtualFilePath("/Avatar.mkv")
+ .computeHashes(BoolInt.ONE)
+ .ingestNonMatches(BoolInt.ONE)
+ .build();
+
+ IngestTransientItemResponse res = sdk.library().ingestTransientItem()
+ .request(req)
.call();
- if (res.object().isPresent()) {
+ if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
- lang: typescript
- label: library
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { GetGenresLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts, BoolInt } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.library.getGenresLibrary(9518, GetGenresLibraryQueryParamType.TvShow);
+ const result = await plexAPI.library.ingestTransientItem({
+ url: "file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv",
+ virtualFilePath: "/Avatar.mkv",
+ computeHashes: BoolInt.One,
+ ingestNonMatches: BoolInt.One,
+ });
- // Handle the result
console.log(result);
}
run();
- '/library/sections/{sectionKey}/country':
+ /library/matches:
get:
+ summary: Get library matches
+ operationId: getLibraryMatches
+ description: |-
+ The matches endpoint is used to match content external to the library with content inside the library. This is done by passing a series of semantic "hints" about the content (its type, name, or release year). Each type (e.g. movie) has a canonical set of minimal required hints.
+ This ability to match content is useful in a variety of scenarios. For example, in the DVR, the EPG uses the endpoint to match recording rules against airing content. And in the cloud, the UMP uses the endpoint to match up a piece of media with rich metadata.
+ The endpoint response can including multiple matches, if there is ambiguity, each one containing a `score` from 0 to 100. For somewhat historical reasons, anything over 85 is considered a positive match (we prefer false negatives over false positives in general for matching).
+ The `guid` hint is somewhat special, in that it generally represents a unique identity for a piece of media (e.g. the IMDB `ttXXX`) identifier, in contrast with other hints which can be much more ambiguous (e.g. a title of `Jane Eyre`, which could refer to the 1943 or the 2011 version).
+ Episodes require either a season/episode pair, or an air date (or both). Either the path must be sent, or the show title
tags:
- Library
- summary: Get Countries of library media
- operationId: get-countries-library
- description: |
- Retrieves a list of all the countries that are found for the media in this library.
parameters:
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- - name: type
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - $ref: '#/components/parameters/type'
+ - name: includeFullMetadata
in: query
- description: |
- The type of media to retrieve or filter by.
- 1 = movie
- 2 = show
- 3 = season
- 4 = episode
- E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
schema:
- type: integer
- enum:
- - 1
- - 2
- - 3
- - 4
- - 8
- - 9
- - 10
- example: 2
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - AUDIO
- - ALBUM
- - TRACK
- required: true
- - name: Accept
- in: header
- required: false
+ description: Whether or not to include full metadata on a positive match. When set, and the best match exceeds a score threshold of 85, metadata as rich as possible is sent back.
+ $ref: "#/components/schemas/BoolInt"
+ - name: includeAncestorMetadata
+ in: query
+ schema:
+ description: Whether or not to include metadata for the item's ancestor (e.g. show and season data for an episode).
+ $ref: "#/components/schemas/BoolInt"
+ - name: includeAlternateMetadataSources
+ in: query
+ schema:
+ description: Whether or not to return all sources for each metadata field, which results in a different structure being passed back.
+ $ref: "#/components/schemas/BoolInt"
+ - name: guid
+ description: Used for movies, shows, artists, albums, and tracks. Allowed for various URI schemes, to be defined.
+ in: query
+ schema:
+ type: string
+ - $ref: '#/components/parameters/title'
+ - name: year
+ description: Used for movies shows, and albums. Optional.
+ in: query
+ schema:
+ type: integer
+ - name: path
+ description: Used for movies, episodes, and tracks. The full path to the media file, used for "cloud-scanning" an item.
+ in: query
+ schema:
+ type: string
+ - name: grandparentTitle
+ description: Used for episodes and tracks. The title of the show/artist. Required if `path` isn't passed.
+ in: query
+ schema:
+ type: string
+ - name: grandparentYear
+ description: Used for episodes. The year of the show.
+ in: query
+ schema:
+ type: integer
+ - name: parentIndex
+ description: Used for episodes and tracks. The season/album number.
+ in: query
+ schema:
+ type: integer
+ - name: index
+ description: Used for episodes and tracks. The episode/tracks number in the season/album.
+ in: query
+ schema:
+ type: integer
+ - name: originallyAvailableAt
+ description: Used for episodes. In the format `YYYY-MM-DD`.
+ in: query
+ schema:
+ type: string
+ - name: parentTitle
+ description: Used for albums and tracks. The artist name for albums or the album name for tracks.
+ in: query
schema:
type: string
- enum:
- - application/json
- - application/xml
- example: application/json
responses:
'200':
- description: Successful response containing media container data.
+ description: OK
+ headers:
+ X-Plex-Container-Start:
+ description: Provided on all MediaContainer objects indicating the offset of where this container page starts
+ schema:
+ type: integer
+ X-Plex-Container-Total-Size:
+ description: Provided on all MediaContainer objects indicating the total size of objects available
+ schema:
+ type: integer
content:
application/json:
schema:
- type: object
- properties:
- MediaContainer:
- allOf:
- - type: object
- required:
- - size
- properties:
- size:
- description: Number of media items returned in this response.
- type: integer
- format: int32
- example: 50
- - type: object
- required:
- - allowSync
- properties:
- allowSync:
- type: boolean
- description: Indicates whether syncing is allowed.
- example: false
- - type: object
- required:
- - art
- properties:
- art:
- type: string
- description: URL for the background artwork of the media container.
- example: '/:/resources/show-fanart.jpg'
- - type: object
- required:
- - content
- properties:
- content:
- type: string
- description: The content type or mode.
- example: secondary
- - type: object
- required:
- - identifier
- properties:
- identifier:
- type: string
- description: An plugin identifier for the media container.
- example: com.plexapp.plugins.library
- - type: object
- required:
- - mediaTagPrefix
- properties:
- mediaTagPrefix:
- type: string
- description: The prefix used for media tag resource paths.
- example: /system/bundle/media/flags/
- - type: object
- required:
- - mediaTagVersion
- properties:
- mediaTagVersion:
- type: integer
- description: The version number for media tags.
- example: 1734362201
- - type: object
- required:
- - nocache
- properties:
- nocache:
- type: boolean
- description: Specifies whether caching is disabled.
- example: true
- - type: object
- required:
- - thumb
- properties:
- thumb:
- type: string
- description: URL for the thumbnail image of the media container.
- example: '/:/resources/show.png'
- - type: object
- required:
- - title1
- properties:
- title1:
- type: string
- description: The primary title of the media container.
- example: TV Series
- - type: object
- required:
- - title2
- properties:
- title2:
- type: string
- description: The secondary title of the media container.
- example: By Starring Actor
- - type: object
- required:
- - viewGroup
- properties:
- viewGroup:
- type: string
- description: Identifier for the view group layout.
- example: secondary
- - type: object
- properties:
- Directory:
- type: array
- items:
- type: object
- required:
- - fastKey
- - key
- - title
- properties:
- fastKey:
- type: string
- example: /library/sections/2/all?country=15491
- key:
- type: string
- example: '15491'
- title:
- type: string
- example: Japan
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- '404':
- description: Not Found - Returned if the resource could not be found
- content:
- text/html:
- example: |
-
-
-
- Not Found
-
-
- 404 Not Found
-
-
+ $ref: '#/components/schemas/MediaContainerWithMetadata'
x-codeSamples:
- - lang: php
- label: library
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->getCountriesLibrary(
- sectionKey: 9518,
- type: Operations\GetCountriesLibraryQueryParamType::TvShow
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: library
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_countries_library(section_key=9518, type=::PlexRubySDK::Operations::GetCountriesLibraryQueryParamType::TV_SHOW)\n\nif ! res.object.nil?\n # handle response\nend"
- lang: go
- label: library
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetCountriesLibrary(ctx, 9518, operations.GetCountriesLibraryQueryParamTypeTvShow)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Library.GetLibraryMatches(ctx, operations.GetLibraryMatchesRequest{
+ IncludeFullMetadata: components.BoolIntOne.ToPointer(),
+ IncludeAncestorMetadata: components.BoolIntOne.ToPointer(),
+ IncludeAlternateMetadataSources: components.BoolIntOne.ToPointer(),
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.MediaContainerWithMetadata != nil {
+ // handle response
+ }
+ }
- lang: java
- label: library
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetCountriesLibraryBadRequest;
- import dev.plexapi.plexapi.models.errors.GetCountriesLibraryUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetCountriesLibraryQueryParamType;
- import dev.plexapi.plexapi.models.operations.GetCountriesLibraryResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetLibraryMatchesRequest;
+ import dev.plexapi.sdk.models.operations.GetLibraryMatchesResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetCountriesLibraryBadRequest, GetCountriesLibraryUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetCountriesLibraryResponse res = sdk.library().getCountriesLibrary()
- .sectionKey(9518)
- .type(GetCountriesLibraryQueryParamType.TvShow)
+ GetLibraryMatchesRequest req = GetLibraryMatchesRequest.builder()
+ .includeFullMetadata(BoolInt.ONE)
+ .includeAncestorMetadata(BoolInt.ONE)
+ .includeAlternateMetadataSources(BoolInt.ONE)
+ .build();
+
+ GetLibraryMatchesResponse res = sdk.library().getLibraryMatches()
+ .request(req)
.call();
- if (res.object().isPresent()) {
+ if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
- lang: typescript
- label: library
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { GetCountriesLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts, BoolInt } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.library.getCountriesLibrary(9518, GetCountriesLibraryQueryParamType.TvShow);
+ const result = await plexAPI.library.getLibraryMatches({
+ includeFullMetadata: BoolInt.One,
+ includeAncestorMetadata: BoolInt.One,
+ includeAlternateMetadataSources: BoolInt.One,
+ });
- // Handle the result
console.log(result);
}
run();
- '/library/sections/{sectionKey}/actor':
- get:
+ /library/optimize:
+ put:
+ summary: Optimize the Database
+ operationId: optimizeDatabase
+ description: Initiate optimize on the database.
tags:
- Library
- summary: Get Actors of library media
- operationId: get-actors-library
- description: |
- Retrieves a list of all the actors that are found for the media in this library.
+ security:
+ - token:
+ - admin
parameters:
- - name: sectionKey
- description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n"
- in: path
- schema:
- type: integer
- format: int32
- example: 9518
- required: true
- - name: type
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: async
+ description: If set, don't wait for completion but return an activity
in: query
- description: |
- The type of media to retrieve or filter by.
- 1 = movie
- 2 = show
- 3 = season
- 4 = episode
- E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
schema:
- type: integer
- enum:
- - 1
- - 2
- - 3
- - 4
- - 8
- - 9
- - 10
- example: 2
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - AUDIO
- - ALBUM
- - TRACK
- required: true
- - name: Accept
- in: header
- required: false
- schema:
- type: string
- enum:
- - application/json
- - application/xml
- example: application/json
+ $ref: "#/components/schemas/BoolInt"
responses:
'200':
- description: Successful response containing media container data.
- content:
- application/json:
- schema:
- type: object
- properties:
- MediaContainer:
- allOf:
- - type: object
- required:
- - size
- properties:
- size:
- description: Number of media items returned in this response.
- type: integer
- format: int32
- example: 50
- - type: object
- required:
- - allowSync
- properties:
- allowSync:
- type: boolean
- description: Indicates whether syncing is allowed.
- example: false
- - type: object
- required:
- - art
- properties:
- art:
- type: string
- description: URL for the background artwork of the media container.
- example: '/:/resources/show-fanart.jpg'
- - type: object
- required:
- - identifier
- properties:
- identifier:
- type: string
- description: An plugin identifier for the media container.
- example: com.plexapp.plugins.library
- - type: object
- required:
- - mediaTagPrefix
- properties:
- mediaTagPrefix:
- type: string
- description: The prefix used for media tag resource paths.
- example: /system/bundle/media/flags/
- - type: object
- required:
- - mediaTagVersion
- properties:
- mediaTagVersion:
- type: integer
- description: The version number for media tags.
- example: 1734362201
- - type: object
- required:
- - nocache
- properties:
- nocache:
- type: boolean
- description: Specifies whether caching is disabled.
- example: true
- - type: object
- required:
- - thumb
- properties:
- thumb:
- type: string
- description: URL for the thumbnail image of the media container.
- example: '/:/resources/show.png'
- - type: object
- required:
- - title1
- properties:
- title1:
- type: string
- description: The primary title of the media container.
- example: TV Series
- - type: object
- required:
- - title2
- properties:
- title2:
- type: string
- description: The secondary title of the media container.
- example: By Starring Actor
- - type: object
- required:
- - viewGroup
- properties:
- viewGroup:
- type: string
- description: Identifier for the view group layout.
- example: secondary
- - type: object
- required:
- - viewMode
- properties:
- viewMode:
- type: string
- description: Identifier for the view mode.
- example: '131131'
- - type: object
- properties:
- Directory:
- type: array
- description: An array of actor entries for media items.
- items:
- type: object
- required:
- - fastKey
- - thumb
- - key
- - title
- properties:
- fastKey:
- type: string
- description: A fast lookup key for the actor relative url.
- example: /library/sections/2/all?actor=134671
- thumb:
- type: string
- description: URL for the thumbnail image of the actor.
- example: 'https://metadata-static.plex.tv/e/people/e2a915b537ef720252b6d408bc1f91b3.jpg'
- key:
- type: string
- description: A unique key representing the actor.
- example: '134671'
- title:
- type: string
- description: The name of the actor.
- example: Aaron Paul
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
- '404':
- description: Not Found - Returned if the resource could not be found
- content:
- text/html:
- example: |
-
-
-
- Not Found
-
-
- 404 Not Found
-
-
+ $ref: '#/components/responses/200'
x-codeSamples:
- - lang: php
- label: library
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
-
-
- $response = $sdk->library->getActorsLibrary(
- sectionKey: 9518,
- type: Operations\GetActorsLibraryQueryParamType::TvShow
-
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: library
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_actors_library(section_key=9518, type=::PlexRubySDK::Operations::GetActorsLibraryQueryParamType::TV_SHOW)\n\nif ! res.object.nil?\n # handle response\nend"
- lang: go
- label: library
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetActorsLibrary(ctx, 9518, operations.GetActorsLibraryQueryParamTypeTvShow)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Library.OptimizeDatabase(ctx, operations.OptimizeDatabaseRequest{
+ Async: components.BoolIntOne.ToPointer(),
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res != nil {
+ // handle response
+ }
+ }
- lang: java
- label: library
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetActorsLibraryBadRequest;
- import dev.plexapi.plexapi.models.errors.GetActorsLibraryUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetActorsLibraryQueryParamType;
- import dev.plexapi.plexapi.models.operations.GetActorsLibraryResponse;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.OptimizeDatabaseRequest;
+ import dev.plexapi.sdk.models.operations.OptimizeDatabaseResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
+ import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
- public static void main(String[] args) throws GetActorsLibraryBadRequest, GetActorsLibraryUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetActorsLibraryResponse res = sdk.library().getActorsLibrary()
- .sectionKey(9518)
- .type(GetActorsLibraryQueryParamType.TvShow)
+ OptimizeDatabaseRequest req = OptimizeDatabaseRequest.builder()
+ .async(BoolInt.ONE)
+ .build();
+
+ OptimizeDatabaseResponse res = sdk.library().optimizeDatabase()
+ .request(req)
.call();
- if (res.object().isPresent()) {
- // handle response
- }
+ // handle response
}
}
- lang: typescript
- label: library
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { GetActorsLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts, BoolInt } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "",
+ accepts: Accepts.ApplicationXml,
+ clientIdentifier: "abc123",
+ product: "Plex for Roku",
+ version: "2.4.1",
+ platform: "Roku",
+ platformVersion: "4.3 build 1057",
+ device: "Roku 3",
+ model: "4200X",
+ deviceVendor: "Roku",
+ deviceName: "Living Room TV",
+ marketplace: "googlePlay",
});
async function run() {
- const result = await plexAPI.library.getActorsLibrary(9518, GetActorsLibraryQueryParamType.TvShow);
+ const result = await plexAPI.library.optimizeDatabase({
+ async: BoolInt.One,
+ });
- // Handle the result
console.log(result);
}
run();
- /library/search:
+ /library/randomArtwork:
get:
+ summary: Get random artwork
+ operationId: getRandomArtwork
+ description: |
+ Get random artwork across sections. This is commonly used for a screensaver.
+
+ This retrieves 100 random artwork paths in the specified sections and returns them. Restrictions are put in place to not return artwork for items the user is not allowed to access. Artwork will be for Movies, Shows, and Artists only.
tags:
- Library
- summary: Search All Libraries
- operationId: get-search-all-libraries
- description: |
- Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.
parameters:
- - name: query
+ - $ref: "#/components/parameters/accepts"
+ - $ref: "#/components/parameters/X-Plex-Client-Identifier"
+ - $ref: "#/components/parameters/X-Plex-Product"
+ - $ref: "#/components/parameters/X-Plex-Version"
+ - $ref: "#/components/parameters/X-Plex-Platform"
+ - $ref: "#/components/parameters/X-Plex-Platform-Version"
+ - $ref: "#/components/parameters/X-Plex-Device"
+ - $ref: "#/components/parameters/X-Plex-Model"
+ - $ref: "#/components/parameters/X-Plex-Device-Vendor"
+ - $ref: "#/components/parameters/X-Plex-Device-Name"
+ - $ref: "#/components/parameters/X-Plex-Marketplace"
+ - name: sections
+ description: The sections for which to fetch artwork.
in: query
- required: true
- schema:
- type: string
- description: The search query term.
- - name: X-Plex-Client-Identifier
- x-speakeasy-name-override: ClientID
- description: 'An opaque identifier unique to the client (UUID, serial number, or other unique device ID)'
- required: true
- in: header
- schema:
- type: string
- example: 3381b62b-9ab7-4e37-827b-203e9809eb58
- - name: limit
- in: query
- required: false
- schema:
- type: integer
- description: Limit the number of results returned.
- - name: searchTypes
- in: query
- required: false
+ explode: false
schema:
type: array
items:
- type: string
- enum:
- - movies
- - music
- - otherVideos
- - people
- - tv
- example: 'movies,music,otherVideos,people,tv'
- style: form
- explode: false
- description: |
- A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
- - name: includeCollections
- in: query
- required: false
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- description: Whether to include collections in the search results.
- - name: includeExternalMedia
- in: query
- required: false
- schema:
- type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- description: Whether to include external media in the search results.
+ type: integer
+ example:
+ - 5
+ - 6
responses:
'200':
- description: The libraries available on the Server
+ description: OK
content:
application/json:
schema:
- type: object
- required:
- - MediaContainer
- properties:
- MediaContainer:
- type: object
- required:
- - size
- - SearchResult
- properties:
- size:
- type: number
- SearchResult:
- type: array
- items:
- type: object
- required:
- - score
- - Metadata
- properties:
- score:
- type: number
- format: float
- Metadata:
- type: object
- required:
- - ratingKey
- - key
- - guid
- - title
- - type
- - addedAt
- - summary
- properties:
- ratingKey:
- type: string
- example: '58683'
- description: |
- The rating key (Media ID) of this media item.
- Note: This is always an integer, but is represented as a string in the API.
- key:
- type: string
- example: /library/metadata/58683
- guid:
- type: string
- example: 'plex://movie/5d7768ba96b655001fdc0408'
- studio:
- type: string
- example: 20th Century Studios
- skipChildren:
- type: boolean
- example: false
- librarySectionID:
- type: integer
- examples:
- - 1
- librarySectionTitle:
- type: string
- example: Movies
- librarySectionKey:
- type: string
- example: /library/sections/1
- type:
- type: string
- enum:
- - movie
- - show
- - season
- - episode
- - artist
- - album
- example: movie
- description: |
- The type of media content
- x-speakeasy-enums:
- - MOVIE
- - TV_SHOW
- - SEASON
- - EPISODE
- - ARTIST
- - ALBUM
- title:
- type: string
- example: 'Avatar: The Way of Water'
- slug:
- type: string
- example: 4-for-texas
- contentRating:
- type: string
- example: PG-13
- summary:
- type: string
- example: 'Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na''vi race to protect their home.'
- rating:
- type: number
- example: 7.6
- audienceRating:
- type: number
- example: 9.2
- year:
- type: integer
- format: int32
- example: 2022
- seasonCount:
- type: integer
- format: int32
- example: 2022
- tagline:
- type: string
- example: Return to Pandora.
- flattenSeasons:
- type: string
- description: 'Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).'
- enum:
- - '-1'
- - '0'
- - '1'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - HIDE
- - SHOW
- example: '1'
- episodeSort:
- type: string
- description: 'Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).'
- enum:
- - '-1'
- - '0'
- - '1'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - OLDEST_FIRST
- - NEWEST_FIRST
- example: '0'
- enableCreditsMarkerGeneration:
- type: string
- description: 'Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).'
- enum:
- - '-1'
- - '0'
- x-speakeasy-enums:
- - LIBRARY_DEFAULT
- - DISABLED
- example: '-1'
- showOrdering:
- type: string
- description: |
- Setting that indicates the episode ordering for the show.
- None = Library default,
- tmdbAiring = The Movie Database (Aired),
- aired = TheTVDB (Aired),
- dvd = TheTVDB (DVD),
- absolute = TheTVDB (Absolute)).
- enum:
- - None
- - tmdbAiring
- - aired
- - dvd
- - absolute
- x-speakeasy-enums:
- - NONE
- - TMDB_AIRING
- - TVDB_AIRED
- - TVDB_DVD
- - TVDB_ABSOLUTE
- example: absolute
- thumb:
- type: string
- example: /library/metadata/58683/thumb/1703239236
- art:
- type: string
- example: /library/metadata/58683/art/1703239236
- banner:
- type: string
- example: /library/metadata/58683/banner/1703239236
- duration:
- type: integer
- format: int32
- example: 11558112
- originallyAvailableAt:
- type: string
- format: date
- example: 2022-12-14T00:00:00.000Z
- addedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- updatedAt:
- type:
- - integer
- example: 1556281940
- description: Unix epoch datetime in seconds
- format: int64
- audienceRatingImage:
- type: string
- example: 'rottentomatoes://image.rating.upright'
- chapterSource:
- type: string
- example: media
- primaryExtraKey:
- type: string
- example: /library/metadata/58684
- ratingImage:
- type: string
- example: 'rottentomatoes://image.rating.ripe'
- grandparentRatingKey:
- type: string
- example: '66'
- grandparentGuid:
- type: string
- example: 'plex://show/5d9c081b170e24001f2a7be4'
- grandparentKey:
- type: string
- example: /library/metadata/66
- grandparentTitle:
- type: string
- example: Caprica
- grandparentThumb:
- type: string
- example: /library/metadata/66/thumb/1705716261
- parentSlug:
- type: string
- example: alice-in-borderland-2020
- grandparentSlug:
- type: string
- example: alice-in-borderland-2020
- grandparentArt:
- type: string
- example: /library/metadata/66/art/1705716261
- grandparentTheme:
- type: string
- example: /library/metadata/66/theme/1705716261
- Media:
- description: |
- The Media object is only included when type query is `4` or higher.
- type: array
- items:
- type: object
- required:
- - id
- - container
- - Part
- properties:
- id:
- type: integer
- format: int32
- example: 119534
- duration:
- type: integer
- format: int32
- example: 11558112
- bitrate:
- type: integer
- format: int32
- example: 25025
- width:
- type: integer
- format: int32
- example: 3840
- height:
- type: integer
- format: int32
- example: 2072
- aspectRatio:
- type: number
- example: 1.85
- audioProfile:
- type: string
- example: dts
- audioChannels:
- type: integer
- format: int32
- example: 6
- audioCodec:
- type: string
- example: eac3
- videoCodec:
- type: string
- example: hevc
- videoResolution:
- type: string
- example: 4k
- container:
- type: string
- example: mkv
- videoFrameRate:
- type: string
- example: 24p
- videoProfile:
- type: string
- example: main 10
- hasVoiceActivity:
- type: boolean
- example: false
- optimizedForStreaming:
- allOf:
- - type: integer
- format: int32
- enum:
- - 0
- - 1
- example: 1
- default: 0
- x-speakeasy-enums:
- - DISABLE
- - ENABLE
- has64bitOffsets:
- type: boolean
- example: false
- Part:
- type: array
- items:
- type: object
- required:
- - id
- - key
- - file
- - size
- - container
- properties:
- id:
- type: integer
- format: int32
- example: 119542
- key:
- type: string
- example: /library/parts/119542/1680457526/file.mkv
- duration:
- type: integer
- format: int32
- example: 11558112
- file:
- type: string
- example: /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv
- size:
- type: integer
- format: int64
- example: 36158371307
- container:
- type: string
- description: |
- The container format of the media file.
- example: mkv
- audioProfile:
- type: string
- example: dts
- has64bitOffsets:
- type: boolean
- example: false
- optimizedForStreaming:
- type: boolean
- example: false
- videoProfile:
- type: string
- example: main 10
- indexes:
- type: string
- example: sd
- hasThumbnail:
- type: string
- enum:
- - '0'
- - '1'
- example: '1'
- default: '0'
- x-speakeasy-enums:
- - false
- - true
- Stream:
- type: array
- items:
- type: object
- required:
- - id
- - streamType
- - codec
- - index
- properties:
- id:
- type: integer
- example: 272796
- streamType:
- type: integer
- description: 'Type of stream (1 = video, 2 = audio, 3 = subtitle)'
- example: 1
- default:
- type: boolean
- description: Indicates if this is the default stream
- example: true
- selected:
- type: boolean
- description: Indicates if the stream is selected
- example: true
- codec:
- type: string
- description: Codec used by the stream
- example: h264
- index:
- type: integer
- description: The index of the stream
- example: 0
- bitrate:
- type: integer
- description: The bitrate of the stream in kbps
- example: 6273
- colorPrimaries:
- type: string
- description: The color primaries of the video stream
- example: bt709
- colorRange:
- type: string
- description: The color range of the video stream
- example: tv
- colorSpace:
- type: string
- description: The color space of the video stream
- example: bt709
- colorTrc:
- type: string
- description: The transfer characteristics (TRC) of the video stream
- example: bt709
- bitDepth:
- type: integer
- description: The bit depth of the video stream
- example: 8
- chromaLocation:
- type: string
- description: The chroma location of the video stream
- example: left
- streamIdentifier:
- type: string
- description: The identifier of the video stream
- example: '2'
- chromaSubsampling:
- type: string
- description: The chroma subsampling format
- example: '4:2:0'
- codedHeight:
- type: integer
- description: The coded height of the video stream
- example: 1088
- codedWidth:
- type: integer
- description: The coded width of the video stream
- example: 1920
- frameRate:
- type: number
- description: The frame rate of the video stream
- example: 29.97
- hasScalingMatrix:
- type: boolean
- description: Indicates if the stream has a scaling matrix
- example: false
- hearingImpaired:
- type: boolean
- example: false
- closedCaptions:
- type: boolean
- example: false
- embeddedInVideo:
- type: string
- example: '1'
- height:
- type: integer
- description: The height of the video stream
- example: 1080
- level:
- type: integer
- description: The level of the video codec
- example: 40
- profile:
- type: string
- description: The profile of the video codec
- example: main
- refFrames:
- type: integer
- description: Number of reference frames
- example: 4
- scanType:
- type: string
- description: The scan type (progressive or interlaced)
- example: progressive
- width:
- type: integer
- description: The width of the video stream
- example: 1920
- displayTitle:
- type: string
- description: Display title of the stream
- example: 1080p (H.264)
- extendedDisplayTitle:
- type: string
- description: Extended display title of the stream
- example: 1080p (H.264)
- channels:
- type: integer
- description: Number of audio channels (for audio streams)
- example: 2
- language:
- type: string
- description: The language of the stream (for audio/subtitle streams)
- example: English
- languageTag:
- type: string
- description: Language tag of the stream
- example: en
- languageCode:
- type: string
- description: Language code of the stream
- example: eng
- audioChannelLayout:
- type: string
- description: The audio channel layout
- example: stereo
- samplingRate:
- type: integer
- description: Sampling rate of the audio stream in Hz
- example: 48000
- title:
- type: string
- description: Title of the subtitle track (for subtitle streams)
- example: English
- canAutoSync:
- type: boolean
- description: Indicates if the subtitle stream can auto-sync
- example: false
- Genre:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Adventure
- Country:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: United States of America
- Director:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: James Cameron
- Writer:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: James Cameron
- Collection:
- type: array
- items:
- type: object
- properties:
- tag:
- type: string
- example: Working NL Subs
- Role:
- type: array
- items:
- type: object
- properties:
- id:
- type: integer
- description: The ID of the tag or actor.
- example: 294129
- filter:
- type: string
- description: The filter used to find the actor or tag.
- example: actor=294129
- thumb:
- type: string
- description: The thumbnail of the actor
- example: 'https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg'
- tag:
- type: string
- description: The name of the tag or actor.
- example: Mike Smith
- tagKey:
- type: string
- description: Unique identifier for the tag.
- example: 668e7e7b22bcad9064350c91
- role:
- type: string
- description: The role of the actor or tag in the media.
- example: Self
- Location:
- type: array
- items:
- type: object
- properties:
- path:
- type: string
- example: /TV Shows/House
- Guid:
- x-speakeasy-name-override: MediaGuid
- description: |
- The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
- type: array
- items:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- description: |
- Can be one of the following formats:
- imdb://tt13015952, tmdb://2434012, tvdb://7945991
- example: 'imdb://tt13015952'
- UltraBlurColors:
- type: object
- required:
- - topLeft
- - topRight
- - bottomRight
- - bottomLeft
- properties:
- topLeft:
- type: string
- example: 11333b
- topRight:
- type: string
- example: 0a232d
- bottomRight:
- type: string
- example: 073958
- bottomLeft:
- type: string
- example: 1f5066
- Rating:
- x-speakeasy-name-override: MetaDataRating
- type: array
- items:
- type: object
- required:
- - image
- - value
- - type
- properties:
- image:
- type: string
- description: A URI or path to the rating image.
- example: 'themoviedb://image.rating'
- value:
- type: number
- format: float
- description: The value of the rating.
- example: 3
- type:
- type: string
- description: 'The type of rating (e.g., audience, critic).'
- example: audience
- Image:
- type: array
- items:
- type: object
- required:
- - alt
- - type
- - url
- properties:
- alt:
- type: string
- example: Episode 1
- type:
- type: string
- enum:
- - coverPoster
- - background
- - snapshot
- - clearLogo
- example: background
- url:
- type: string
- example: /library/metadata/45521/thumb/1644710589
- titleSort:
- type: string
- example: Whale
- viewCount:
- type: integer
- format: int32
- example: 1
- lastViewedAt:
- type: integer
- format: int32
- example: 1682752242
- originalTitle:
- type: string
- example: 映画 ブラッククローバー 魔法帝の剣
- viewOffset:
- type: integer
- format: int32
- example: 5222500
- skipCount:
- type: integer
- format: int32
- example: 1
- index:
- type: integer
- format: int32
- example: 1
- theme:
- type: string
- example: /library/metadata/1/theme/1705636920
- leafCount:
- type: integer
- format: int32
- example: 14
- viewedLeafCount:
- type: integer
- format: int32
- example: 0
- childCount:
- type: integer
- format: int32
- example: 1
- hasPremiumExtras:
- type: string
- example: '1'
- hasPremiumPrimaryExtra:
- type: string
- example: '1'
- parentRatingKey:
- type: string
- description: |
- The rating key of the parent item.
- example: '66'
- parentGuid:
- type: string
- example: 'plex://show/5d9c081b170e24001f2a7be4'
- parentStudio:
- type: string
- example: UCP
- parentKey:
- type: string
- example: /library/metadata/66
- parentTitle:
- type: string
- example: Caprica
- parentIndex:
- type: integer
- format: int32
- example: 1
- parentYear:
- type: integer
- format: int32
- example: 2010
- parentThumb:
- type: string
- example: /library/metadata/66/thumb/1705716261
- parentTheme:
- type: string
- example: /library/metadata/66/theme/1705716261
- '400':
- description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
- content:
- application/json:
- schema:
- x-speakeasy-name-override: BadRequest
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1000
- message:
- type: string
- x-speakeasy-error-message: true
- example: X-Plex-Client-Identifier is missing
- status:
- type: integer
- format: int32
- example: 400
- '401':
- description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
- content:
- application/json:
- schema:
- x-speakeasy-name-override: Unauthorized
- type: object
- properties:
- errors:
- type: array
- items:
- type: object
- properties:
- code:
- type: integer
- format: int32
- example: 1001
- message:
- type: string
- x-speakeasy-error-message: true
- example: User could not be authenticated
- status:
- type: integer
- format: int32
- example: 401
+ $ref: '#/components/schemas/MediaContainerWithArtwork'
x-codeSamples:
- - lang: php
- label: libraries
- source: |-
- declare(strict_types=1);
-
- require 'vendor/autoload.php';
-
- use LukeHagar\Plex_API;
- use LukeHagar\Plex_API\Models\Operations;
-
- $sdk = Plex_API\PlexAPI::builder()
- ->setSecurity(
- ''
- )
- ->build();
-
- $request = new Operations\GetSearchAllLibrariesRequest(
- query: '',
- clientID: '3381b62b-9ab7-4e37-827b-203e9809eb58',
- searchTypes: [
- Operations\SearchTypes::People,
- ],
- );
-
- $response = $sdk->library->getSearchAllLibraries(
- request: $request
- );
-
- if ($response->object !== null) {
- // handle response
- }
- - lang: ruby
- label: libraries
- source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetSearchAllLibrariesRequest.new(\n query: \"\",\n client_id: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n search_types: [\n ::PlexRubySDK::Operations::SearchTypes::PEOPLE,\n ],\n include_collections: ::PlexRubySDK::Operations::GetSearchAllLibrariesQueryParamIncludeCollections::ENABLE,\n include_external_media: ::PlexRubySDK::Operations::GetSearchAllLibrariesQueryParamIncludeExternalMedia::ENABLE,\n)\n \nres = s.library.get_search_all_libraries(req)\n\nif ! res.object.nil?\n # handle response\nend"
- lang: go
- label: libraries
- source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"\"),\n )\n\n res, err := s.Library.GetSearchAllLibraries(ctx, operations.GetSearchAllLibrariesRequest{\n Query: \"\",\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n SearchTypes: []operations.SearchTypes{\n operations.SearchTypesPeople,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
+ label: PlexGO
+ source: |-
+ package main
+
+ import(
+ "context"
+ "github.com/LukeHagar/plexgo/models/components"
+ "github.com/LukeHagar/plexgo"
+ "github.com/LukeHagar/plexgo/models/operations"
+ "log"
+ )
+
+ func main() {
+ ctx := context.Background()
+
+ s := plexgo.New(
+ plexgo.WithAccepts(components.AcceptsApplicationXML),
+ plexgo.WithClientIdentifier("abc123"),
+ plexgo.WithProduct("Plex for Roku"),
+ plexgo.WithVersion("2.4.1"),
+ plexgo.WithPlatform("Roku"),
+ plexgo.WithPlatformVersion("4.3 build 1057"),
+ plexgo.WithDevice("Roku 3"),
+ plexgo.WithModel("4200X"),
+ plexgo.WithDeviceVendor("Roku"),
+ plexgo.WithDeviceName("Living Room TV"),
+ plexgo.WithMarketplace("googlePlay"),
+ plexgo.WithSecurity(""),
+ )
+
+ res, err := s.Library.GetRandomArtwork(ctx, operations.GetRandomArtworkRequest{
+ Sections: []int64{
+ 5,
+ 6,
+ },
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ if res.MediaContainerWithArtwork != nil {
+ // handle response
+ }
+ }
- lang: java
- label: libraries
+ label: PlexJava
source: |-
package hello.world;
- import dev.plexapi.plexapi.PlexAPI;
- import dev.plexapi.plexapi.models.errors.GetSearchAllLibrariesBadRequest;
- import dev.plexapi.plexapi.models.errors.GetSearchAllLibrariesUnauthorized;
- import dev.plexapi.plexapi.models.operations.GetSearchAllLibrariesRequest;
- import dev.plexapi.plexapi.models.operations.GetSearchAllLibrariesResponse;
- import dev.plexapi.plexapi.models.operations.SearchTypes;
+ import dev.plexapi.sdk.PlexAPI;
+ import dev.plexapi.sdk.models.operations.GetRandomArtworkRequest;
+ import dev.plexapi.sdk.models.operations.GetRandomArtworkResponse;
+ import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
- public static void main(String[] args) throws GetSearchAllLibrariesBadRequest, GetSearchAllLibrariesUnauthorized, Exception {
+ public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
- .accessToken("")
+ .accepts(Accepts.APPLICATION_XML)
+ .clientIdentifier("abc123")
+ .product("Plex for Roku")
+ .version("2.4.1")
+ .platform("Roku")
+ .platformVersion("4.3 build 1057")
+ .device("Roku 3")
+ .model("4200X")
+ .deviceVendor("Roku")
+ .deviceName("Living Room TV")
+ .marketplace("googlePlay")
+ .token(System.getenv().getOrDefault("TOKEN", ""))
.build();
- GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder()
- .query("")
- .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
- .searchTypes(List.of(
- SearchTypes.PEOPLE))
+ GetRandomArtworkRequest req = GetRandomArtworkRequest.builder()
+ .sections(List.of(
+ 5L,
+ 6L))
.build();
- GetSearchAllLibrariesResponse res = sdk.library().getSearchAllLibraries()
+ GetRandomArtworkResponse res = sdk.library().getRandomArtwork()
.request(req)
.call();
- if (res.object().isPresent()) {
+ if (res.mediaContainerWithArtwork().isPresent()) {
// handle response
}
}
}
- lang: typescript
- label: libraries
+ label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
- import { SearchTypes } from "@lukehagar/plexjs/sdk/models/operations";
+ import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
- accessToken: "