Reputation: 13
I am trying to get the sampled stream using the following code:
url = "https://api.twitter.com/labs/1/tweets/stream/sample"
bearer_token = get_bearer_token(##########, #########)
bearer = "Bearer " + bearer_token
headers = {"Authorization": bearer}
print(requests.post(url, headers=headers))
I am using the oauth here.
Unfortunately it is giving me a 405 response. Help would be greatly appreciated.
Upvotes: 1
Views: 40
Reputation: 26
Looks like you are using POST vs GET.
Check out the API reference here: https://developer.twitter.com/en/docs/labs/sampled-stream/api-reference/get-tweets-stream-sample
Upvotes: 1