Requesting just geotagged statuses from the Twitter API

前端 未结 2 1209
情书的邮戳
情书的邮戳 2021-01-03 03:56

How can I ask the twitter API to give me just geotagged statuses? I\'m currently filtering but it would make more sense to be more \'friendly\'

相关标签:
2条回答
  • 2021-01-03 04:13

    Unless you are requesting a timeline based on a location (as in, "give me all the tweets within x miles of this location"), then no. The API does not currently allow you to get only geo-tagged tweets (or at least, there is no documented way).

    0 讨论(0)
  • 2021-01-03 04:15

    Seems like you should be able to do this with the streaming API and a location filter, just set the bounding box to cover the whole earth:

    Just as with the track parameter, queries are subject to Track Limitations, described in Track Limiting and subject to access roles, described in the statuses/filter method. Both the number and size of bounding boxes is limited. Bounding boxes can be up to 360 degrees longitude by 180 degrees latitude, and you may specify up to 25 bounding boxes. A box of 360-degrees by 180-degrees will cover the whole earth. Higher access levels provide additional bounding boxes.

    And since:

    Only tweets that are both created using the Geotagging API and are placed from within a tracked bounding box will be included in the stream – the user’s location field is not used to filter tweets (e.g. if a user has their location set to “San Francisco”, but the tweet was not created using the Geotagging API and has no geo element, it will not be included in the stream).

    You should then be getting essentially all geotagged statuses.

    0 讨论(0)
提交回复
热议问题