Use the Application only authenticationΒΆ
The application only authentication is restricted to some endpoints. See the Twitter documentation page:
import peony
from peony import PeonyClient
client = PeonyClient(consumer_key=YOUR_CONSUMER_KEY,
consumer_secret=YOUR_CONSUMER_SECRET,
bearer_token=YOUR_BEARER_TOKEN,
auth=peony.oauth.OAuth2Headers)
Note
The bearer_token
parameter is not necessary.