The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when
- ComputeChannelMap - Compute the best channel map
- GetChannels - Get channels for a lineup
- GetCountries - Get all countries
- GetEPGGuide - Get EPG Guide
- GetAllLanguages - Get all languages
- GetLineup - Compute the best lineup
- GetLineupChannels - Get the channels for multiple lineups
- SearchEPG - Search EPG
- GetCountriesLineups - Get lineups for a country via postal code
- GetCountryRegions - Get regions for a country
- ListLineups - Get lineups for a region
Compute the best channel map, given device and lineup
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.Epg.ComputeChannelMap(ctx, operations.ComputeChannelMapRequest{ DeviceQueryParameter: "<value>", Lineup: "<value>", }) if err != nil { log.Fatal(err) } if res.Object != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ComputeChannelMapRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ComputeChannelMapResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
Get channels for a lineup within an EPG provider
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.Epg.GetChannels(ctx, operations.GetChannelsRequest{ Lineup: "<value>", }) if err != nil { log.Fatal(err) } if res.ChannelResponse != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetChannelsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetChannelsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
This endpoint returns a list of countries which EPG data is available for. There are three flavors, as specfied by the flavor attribute
package main import( "context" "github.com/LukeHagar/plexgo" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), ) res, err := s.Epg.GetCountries(ctx) if err != nil { log.Fatal(err) } if res.Object != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetCountriesResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.Error | 401 | application/json |
| sdkerrors.SDKError | 4XX, 5XX | */* |
Fetch the global electronic program guide.
package main import( "context" "github.com/LukeHagar/plexgo" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), ) res, err := s.Epg.GetEPGGuide(ctx) if err != nil { log.Fatal(err) } if res.MediaContainerWithMetadata != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetEPGGuideResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.Error | 401 | application/json |
| sdkerrors.SDKError | 4XX, 5XX | */* |
Returns a list of all possible languages for EPG data.
package main import( "context" "github.com/LukeHagar/plexgo" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), ) res, err := s.Epg.GetAllLanguages(ctx) if err != nil { log.Fatal(err) } if res.Object != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetAllLanguagesResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.Error | 401 | application/json |
| sdkerrors.SDKError | 4XX, 5XX | */* |
Compute the best lineup, given lineup group and device
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.Epg.GetLineup(ctx, operations.GetLineupRequest{ DeviceQueryParameter: "<value>", LineupGroup: "<value>", }) if err != nil { log.Fatal(err) } if res.MediaContainerWithLineup != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetLineupRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetLineupResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
Get the channels across multiple lineups
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.Epg.GetLineupChannels(ctx, operations.GetLineupChannelsRequest{ Lineup: []string{ "<value 1>", "<value 2>", }, }) if err != nil { log.Fatal(err) } if res.Object != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetLineupChannelsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetLineupChannelsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
Search the electronic program guide for upcoming airings.
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.Epg.SearchEPG(ctx, operations.SearchEPGRequest{}) if err != nil { log.Fatal(err) } if res.MediaContainerWithMetadata != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.SearchEPGRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SearchEPGResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.Error | 401 | application/json |
| sdkerrors.SDKError | 4XX, 5XX | */* |
Returns a list of lineups for a given country, EPG provider and postal code
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.Epg.GetCountriesLineups(ctx, operations.GetCountriesLineupsRequest{ Country: "Malawi", EpgID: "<id>", }) if err != nil { log.Fatal(err) } if res.MediaContainerWithLineup != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetCountriesLineupsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetCountriesLineupsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
Get regions for a country within an EPG provider
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.Epg.GetCountryRegions(ctx, operations.GetCountryRegionsRequest{ Country: "Morocco", EpgID: "<id>", }) if err != nil { log.Fatal(err) } if res.Object != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetCountryRegionsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetCountryRegionsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |
Get lineups for a region within an EPG provider
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.Epg.ListLineups(ctx, operations.ListLineupsRequest{ Country: "Vanuatu", EpgID: "<id>", Region: "<value>", }) if err != nil { log.Fatal(err) } if res.MediaContainerWithLineup != nil { // handle response } }
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListLineupsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListLineupsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.SDKError | 4XX, 5XX | */* |