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("<YOUR_API_KEY_HERE>"),
)
res, err := s.Content.GetAlbums(ctx, operations.GetAlbumsRequest{
SectionID: 817133,
})
if err != nil {
log.Fatal(err)
}
if res.MediaContainerWithMetadata != nil {
// handle response
}
}{
"MediaContainer": {
"content": "secondary",
"allowSync": false,
"art": "/:/resources/artist-fanart.jpg",
"identifier": "com.plexapp.plugins.library",
"mediaTagPrefix": "/system/bundle/media/flags/",
"mediaTagVersion": 1680272530,
"Metadata": [
{
"addedAt": 1681152176,
"allowSync": true,
"art": "/library/metadata/251/art/1716801576",
"deletedAt": 1682628386,
"Genre": [
{
"tag": "Comedy/Spoken"
}
],
"guid": "plex://album/5d07c894403c640290c0e196",
"index": 1,
"key": "/library/metadata/265/children",
"leafCount": 12,
"librarySectionID": 3,
"librarySectionTitle": "Music",
"librarySectionUUID": "d7fd8c81-a345-4e68-8113-92f23cb47e70",
"loudnessAnalysisVersion": "2",
"originallyAvailableAt": "2014-07-15",
"parentGuid": "plex://artist/5d07bbfc403c6402904a60e7",
"parentKey": "/library/metadata/251",
"parentRatingKey": "251",
"parentThumb": "/library/metadata/251/thumb/1716801576",
"parentTitle": "“Weird Al” Yankovic",
"rating": 8,
"ratingKey": "265",
"studio": "RCA",
"summary": "Already accepted as a bona fide talent in the world of parody -- his musicianship, comedic timing, his pop-culture reference awareness, and his great wordplay are all well-documented -- the only thing that matters when it comes to \"Weird Al\" Yankovic albums is how inspired the king of novelty songs sounds on any given LP. On his 14th studio album, Mandatory Fun, the inspiration meter goes well into the red, something heard instantly as Iggy Azalea's electro-rap \"Fancy\" does a complete 180 thematically on the opening \"Handy,\" the song now heading toward the local home improvement store where the craftsmen vogue in their orange vests and blow sweet come-ons like \"I'll bring you up to code\" and \"My socket wrenches are second to none.\" Pharrell's \"Happy\" becomes \"Tacky\" and Al's amazing ability to follow an everyday poke (\"Wear my Ed Hardy shirt with fluorescent orange pants\") with something brainy and reserved (\"Got my new résumé, it's printed in Comic Sans\") surprises once more, but for end-to-end \"wows,\" it's his brilliant redo of Robin Thicke's \"Blurred Lines,\" now the smug and twerking \"Word Crimes,\" which gives copy editors, English professors, and grammar nerds a reason to hit the dancefloor (\"And listen up when I tell you this/I hope you never use quotation marks for emphasis!\"). Hardcore and hilarious musical moments start to happen when Imagine Dragons' \"Radioactive\" becomes \"Inactive,\" a singalong anthem for the sluggish and the slovenly (\"Near comatose, no exercise/Don't tag my toe, I'm still alive\") with a dubstep-rock bassline that sounds like Galactus burping. Better still is the every-Al-album pop-polka medley, this time called \"Now That's What I Call Polka!\" which polkas-up Daft Punk (\"Get Lucky\"), PSY (\"Gangnam Style\"), and Miley Cyrus (\"Wrecking Ball\"), and with more Spike Jones-styled sound effects than usual. As for the originals this time out, the \"you suck!\"-minded \"Sports Song\" will be unavoidable under Friday night lights once a teen gets hold of it, while the ranting and wonderfully weird \"First World Problems\" sounds more like the Pixies than anything the Pixies did in 2014. Wonders never cease on Mandatory Fun, and neither do the laughs. ~ David Jeffries",
"thumb": "/library/metadata/265/thumb/1715112705",
"title": "Mandatory Fun",
"type": "album",
"updatedAt": 1715112705,
"year": 2014
}
],
"mixedParents": true,
"nocache": true,
"size": 12,
"thumb": "/:/resources/artist.png",
"title1": "Music",
"title2": "By Album",
"viewGroup": "album"
}
}Get all albums in a music section
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("<YOUR_API_KEY_HERE>"),
)
res, err := s.Content.GetAlbums(ctx, operations.GetAlbumsRequest{
SectionID: 817133,
})
if err != nil {
log.Fatal(err)
}
if res.MediaContainerWithMetadata != nil {
// handle response
}
}{
"MediaContainer": {
"content": "secondary",
"allowSync": false,
"art": "/:/resources/artist-fanart.jpg",
"identifier": "com.plexapp.plugins.library",
"mediaTagPrefix": "/system/bundle/media/flags/",
"mediaTagVersion": 1680272530,
"Metadata": [
{
"addedAt": 1681152176,
"allowSync": true,
"art": "/library/metadata/251/art/1716801576",
"deletedAt": 1682628386,
"Genre": [
{
"tag": "Comedy/Spoken"
}
],
"guid": "plex://album/5d07c894403c640290c0e196",
"index": 1,
"key": "/library/metadata/265/children",
"leafCount": 12,
"librarySectionID": 3,
"librarySectionTitle": "Music",
"librarySectionUUID": "d7fd8c81-a345-4e68-8113-92f23cb47e70",
"loudnessAnalysisVersion": "2",
"originallyAvailableAt": "2014-07-15",
"parentGuid": "plex://artist/5d07bbfc403c6402904a60e7",
"parentKey": "/library/metadata/251",
"parentRatingKey": "251",
"parentThumb": "/library/metadata/251/thumb/1716801576",
"parentTitle": "“Weird Al” Yankovic",
"rating": 8,
"ratingKey": "265",
"studio": "RCA",
"summary": "Already accepted as a bona fide talent in the world of parody -- his musicianship, comedic timing, his pop-culture reference awareness, and his great wordplay are all well-documented -- the only thing that matters when it comes to \"Weird Al\" Yankovic albums is how inspired the king of novelty songs sounds on any given LP. On his 14th studio album, Mandatory Fun, the inspiration meter goes well into the red, something heard instantly as Iggy Azalea's electro-rap \"Fancy\" does a complete 180 thematically on the opening \"Handy,\" the song now heading toward the local home improvement store where the craftsmen vogue in their orange vests and blow sweet come-ons like \"I'll bring you up to code\" and \"My socket wrenches are second to none.\" Pharrell's \"Happy\" becomes \"Tacky\" and Al's amazing ability to follow an everyday poke (\"Wear my Ed Hardy shirt with fluorescent orange pants\") with something brainy and reserved (\"Got my new résumé, it's printed in Comic Sans\") surprises once more, but for end-to-end \"wows,\" it's his brilliant redo of Robin Thicke's \"Blurred Lines,\" now the smug and twerking \"Word Crimes,\" which gives copy editors, English professors, and grammar nerds a reason to hit the dancefloor (\"And listen up when I tell you this/I hope you never use quotation marks for emphasis!\"). Hardcore and hilarious musical moments start to happen when Imagine Dragons' \"Radioactive\" becomes \"Inactive,\" a singalong anthem for the sluggish and the slovenly (\"Near comatose, no exercise/Don't tag my toe, I'm still alive\") with a dubstep-rock bassline that sounds like Galactus burping. Better still is the every-Al-album pop-polka medley, this time called \"Now That's What I Call Polka!\" which polkas-up Daft Punk (\"Get Lucky\"), PSY (\"Gangnam Style\"), and Miley Cyrus (\"Wrecking Ball\"), and with more Spike Jones-styled sound effects than usual. As for the originals this time out, the \"you suck!\"-minded \"Sports Song\" will be unavoidable under Friday night lights once a teen gets hold of it, while the ranting and wonderfully weird \"First World Problems\" sounds more like the Pixies than anything the Pixies did in 2014. Wonders never cease on Mandatory Fun, and neither do the laughs. ~ David Jeffries",
"thumb": "/library/metadata/265/thumb/1715112705",
"title": "Mandatory Fun",
"type": "album",
"updatedAt": 1715112705,
"year": 2014
}
],
"mixedParents": true,
"nocache": true,
"size": 12,
"thumb": "/:/resources/artist.png",
"title1": "Music",
"title2": "By Album",
"viewGroup": "album"
}
}Documentation Index
Fetch the complete documentation index at: https://plexapi.dev/llms.txt
Use this file to discover all available pages before exploring further.
The token which identifies the user accessing the PMS. This can be either:
JWT tokens provide better security with:
Indicates the client accepts the indicated media types
application/json, application/xml An opaque identifier unique to the client
"abc123"
The name of the client product
"Plex for Roku"
The version of the client application
"2.4.1"
The platform of the client
"Roku"
The version of the platform
"4.3 build 1057"
A relatively friendly name for the client device
"Roku 3"
A potentially less friendly identifier for the device model
"4200X"
The device vendor
"Roku"
A friendly name for the client
"Living Room TV"
The marketplace on which the client application is distributed
"googlePlay"
Section identifier
OK
MediaContainer is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.
Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)
The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the parentTitle attribute may appear on the MediaContainer rather than being repeated on each track.
Show child attributes
Was this page helpful?