trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io
179 stars 7 forks source link

Unknown search result type `officiallist` #143

Closed kimdv closed 2 years ago

kimdv commented 4 years ago

This search result contains a type called officiallist. It is not documented and it have also not data?

https://api.trakt.tv/search/list?query=Anna

[
    {
        "type": "list",
        "score": 41.752094,
        "list": {
            "name": "For Anna",
            "description": "",
            "privacy": "public",
            "display_numbers": false,
            "allow_comments": true,
            "sort_by": "rank",
            "sort_how": "asc",
            "created_at": "2019-09-15T19:47:49.000Z",
            "updated_at": "2019-10-06T17:53:43.000Z",
            "item_count": 8,
            "comment_count": 0,
            "likes": 0,
            "ids": {
                "trakt": 9921841,
                "slug": "for-anna"
            },
            "user": {
                "username": "Syphdias",
                "private": false,
                "name": "",
                "vip": true,
                "vip_ep": false,
                "ids": {
                    "slug": "syphdias"
                }
            }
        }
    },
    {
        "type": "officiallist",
        "score": 41.752094
    },
    {
        "type": "list",
        "score": 41.752094,
        "list": {
            "name": "Anna Torv",
            "description": "Anna's filmography",
            "privacy": "public",
            "display_numbers": true,
            "allow_comments": true,
            "sort_by": "rank",
            "sort_how": "asc",
            "created_at": "2015-05-01T16:03:06.000Z",
            "updated_at": "2019-08-29T06:22:19.000Z",
            "item_count": 14,
            "comment_count": 0,
            "likes": 0,
            "ids": {
                "trakt": 1103456,
                "slug": "anna-torv"
            },
            "user": {
                "username": "annastorv",
                "private": false,
                "name": "andrea",
                "vip": false,
                "vip_ep": false,
                "ids": {
                    "slug": "annastorv"
                }
            }
        }
    },
    {
        "type": "list",
        "score": 41.752094,
        "list": {
            "name": "Anna Kendrick",
            "description": "",
            "privacy": "public",
            "display_numbers": false,
            "allow_comments": false,
            "sort_by": "rank",
            "sort_how": "asc",
            "created_at": "2014-09-08T15:48:48.000Z",
            "updated_at": "2019-08-29T06:03:44.000Z",
            "item_count": 22,
            "comment_count": 0,
            "likes": 0,
            "ids": {
                "trakt": 851200,
                "slug": "anna-kendrick"
            },
            "user": {
                "username": "MissLuna",
                "private": false,
                "name": "Cinnamon Girl ",
                "vip": false,
                "vip_ep": false,
                "ids": {
                    "slug": "missluna"
                }
            }
        }
    },
    {
        "type": "list",
        "score": 41.752094,
        "list": {
            "name": "Anna Kendrick",
            "description": "All of Anna Kendrick's movies.",
            "privacy": "public",
            "display_numbers": false,
            "allow_comments": false,
            "sort_by": "rank",
            "sort_how": "asc",
            "created_at": "2014-03-15T20:42:04.000Z",
            "updated_at": "2019-08-29T06:01:30.000Z",
            "item_count": 25,
            "comment_count": 0,
            "likes": 0,
            "ids": {
                "trakt": 837087,
                "slug": "anna-kendrick"
            },
            "user": {
                "username": "ItsZachK",
                "private": false,
                "name": null,
                "vip": false,
                "vip_ep": false,
                "ids": {
                    "slug": "itszachk"
                }
            }
        }
    },
    {
        "type": "list",
        "score": 41.752094,
        "list": {
            "name": "Anna Friel",
            "description": "",
            "privacy": "public",
            "display_numbers": false,
            "allow_comments": false,
            "sort_by": "rank",
            "sort_how": "asc",
            "created_at": "2018-04-10T09:44:16.000Z",
            "updated_at": "2019-08-29T11:33:46.000Z",
            "item_count": 1,
            "comment_count": 0,
            "likes": 0,
            "ids": {
                "trakt": 4715535,
                "slug": "anna-friel"
            },
            "user": {
                "username": "TracieN45",
                "private": false,
                "name": null,
                "vip": false,
                "vip_ep": false,
                "ids": {
                    "slug": "tracien45"
                }
            }
        }
    },
    {
        "type": "list",
        "score": 29.822924,
        "list": {
            "name": "anna and the King",
            "description": "Created by Velocity",
            "privacy": "public",
            "display_numbers": true,
            "allow_comments": true,
            "sort_by": "rank",
            "sort_how": "asc",
            "created_at": "2016-04-21T14:22:52.000Z",
            "updated_at": "2019-08-29T07:51:19.000Z",
            "item_count": 0,
            "comment_count": 0,
            "likes": 0,
            "ids": {
                "trakt": 2177824,
                "slug": "anna-and-the-king"
            },
            "user": {
                "username": "garpec",
                "private": false,
                "name": "Gary Pecoraro",
                "vip": false,
                "vip_ep": false,
                "ids": {
                    "slug": "garpec"
                }
            }
        }
    },
    {
        "type": "list",
        "score": 29.822924,
        "list": {
            "name": "Backlog with Anna",
            "description": "",
            "privacy": "public",
            "display_numbers": true,
            "allow_comments": false,
            "sort_by": "rank",
            "sort_how": "asc",
            "created_at": "2014-09-21T22:24:58.000Z",
            "updated_at": "2019-08-29T06:03:57.000Z",
            "item_count": 1,
            "comment_count": 0,
            "likes": 0,
            "ids": {
                "trakt": 852519,
                "slug": "backlog-with-anna"
            },
            "user": {
                "username": "kaffekask",
                "private": false,
                "name": "Kalle Färm",
                "vip": false,
                "vip_ep": false,
                "ids": {
                    "slug": "kaffekask"
                }
            }
        }
    },
    {
        "type": "list",
        "score": 23.85834,
        "list": {
            "name": "Anna Gunn's 5 Favorite Films",
            "description": "https://editorial.rottentomatoes.com/article/anna-gunns-five-favorite-films/",
            "privacy": "public",
            "display_numbers": false,
            "allow_comments": true,
            "sort_by": "rank",
            "sort_how": "asc",
            "created_at": "2019-11-01T16:36:01.000Z",
            "updated_at": "2019-11-01T16:36:01.000Z",
            "item_count": 0,
            "comment_count": 0,
            "likes": 0,
            "ids": {
                "trakt": 10207134,
                "slug": "anna-gunn-s-5-favorite-films"
            },
            "user": {
                "username": "aksay",
                "private": false,
                "name": "",
                "vip": false,
                "vip_ep": false,
                "ids": {
                    "slug": "aksay"
                }
            }
        }
    },
    {
        "type": "officiallist",
        "score": 3.0452993
    }
]
rectifyer commented 4 years ago

We don't currently support this type of list, so it probably makes the most sense for us to hide it for now. An officiallist is actually a collection from TMDB. For example, the fast and furious collection would be translated to a Trakt official list. But we don't expose that on the website or API yet.

rectifyer commented 2 years ago

I'll have an update for this next week. The search method will correctly return official lists (the object is the same as a standard list). Each list object will have a new type field which can be set to personal, official, watchlist, or recommendations.

To get list info for an official list, use the /lists/:id methods instead of the /users/:slug/lists/:id methods.

{
  "name": "Top Gun Collection",
  "description": "Film series based on the character Lieutenant Pete \"Maverick\" Mitchell, a US Naval Aviator.",
  "privacy": "public",
  "type": "official",
  "display_numbers": true,
  "allow_comments": true,
  "sort_by": "rank",
  "sort_how": "asc",
  "created_at": "2022-06-03T22:57:07.000Z",
  "updated_at": "2022-06-03T23:29:40.000Z",
  "item_count": 2,
  "comment_count": 0,
  "likes": 0,
  "ids": { "trakt": 74, "slug": "top-gun-collection" },
  "user": {
    "username": "Trakt",
    "private": false,
    "name": null,
    "vip": false,
    "vip_ep": false,
    "ids": { "slug": null, "trakt": 0 }
  }
}
minas1 commented 2 years ago

It seems that for "official" lists the user is always not present. Is this expected? Is it documented somewhere?

rectifyer commented 2 years ago

Good catch, I'll have a fix out for this tomorrow.

minas1 commented 2 years ago

Awesome! Please apply it for all custom list types so that we avoid special cases in our apps. :)

rectifyer commented 2 years ago

Official lists are the only special lists not tied to an actual user account. Everything else like watchlist, recommendations, and personal lists are all tied to a user.

minas1 commented 2 years ago

To get list info for an official list, will /users/:slug/lists/:id methods work when the user is added back to those responses?

rectifyer commented 2 years ago

No, the general /lists/:id should be used for official lists. They aren't really tied to user.