How do I get the id of a list?

jamiet
@jamiet Jamie Thomson

Hi,
I'm reading

GET lists/statuses
(https://dev.twitter.com/docs/api/1/get/lists/statuses)

which states:
"Either a list_id or a slug is required"

That's fine, but it doesn't explain how you determine the id of a list. Can someone tell me how to find the id of a list?
thanks in advance

jamiet

2 years 24 weeks ago

Replies

episod
@episod Taylor Singletary

GET lists, and any other node that lists lists will include list ids as part of the response:

The results provided by GET https://api.twitter.com/1/lists.json?screen_name=twitterapi would include a list object with slugs and ids:

  1. {
  2.       "slug": "team",
  3.       "name": "team",
  4.       "uri": "/twitterapi/team",
  5.       "id_str": "2031945",
  6.       "id": 2031945,
  7.       "full_name": "@twitterapi/team",
  8.       "mode": "public",
  9.       ...
  10. }
2 years 23 weeks ago
jamiet
@jamiet Jamie Thomson

Got it, thanks Taylor.

Have to say, I'm surprised that the id of the list isn't returned when you get contents of the list e.g.: http://jsonformatter.curiousconcept.com/#https://api.twitter.com/1/lists/statuses.json?slug=data-explorer&owner_screen_name=jamiet

Any idea if that is deliberate? Or perhaps an oversight?

thanks
Jamie

2 years 23 weeks ago