简体   繁体   中英

API timeline - one entire week

  • I'm new to API and Twitter
  • I managed to retrieve the 'normal' 20 Tweets (Status)
  • Is there a way to retrieve a whole week at once?
  • Or do I have to write a code that permanently calls 20 Tweets and append each after the other?

You can get whole week of tweet by Get User's lookup Tweet V2 API

OR

Get timeline for user by V1.1 API

Tweet User's lookup V2

GET /2/users/{user id}/tweets

get tweet time line by V1.1 API

GET statuses/user_timeline

I will demo both with Mr. Tweet by Postman.

#1 Get access token in here

This token support both V2 and V1.1 API call.

#2 Get Tweets one week by v2

https://api.twitter.com/2/users/44196397/tweets?max_results=20&start_time=2023-01-18T00:00:01Z&end_time=2023-01-25T00:00:01Z

在此处输入图像描述

If you want to more detail information for each tweet. Add attribute option in here by Adding query parameters(like a like count , create at and so on)

在此处输入图像描述

#3 Get timeline, 20 Tweets by v1.1

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=elonmusk&count=20

在此处输入图像描述

Both API needs access token assignment 在此处输入图像描述

Boat API can be programming by node.js or Python languages .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM