Authentication for new Twitter API 1.1

后端 未结 2 720
小鲜肉
小鲜肉 2021-01-01 02:08

I have an application that needs to display number of followers and following (users/show.json) for a random user on a public page (authentication is not requir

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-01 02:31

    The easiest way to do what you're asking is to use Twitter API 1.1's 'application-only authentication' feature, which works for much of the API. See Application-only authentication. You can see a Python example of it in get_bearer_token.py.

    Once you have a bearer token, you only need to include that in your request authorization header - signing is not necessary.

提交回复
热议问题