Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ python-twitter
A simple Python wrapper for Twitter API v2 :sparkles: :cake: :sparkles:.

.. image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fv2
:target: https://developer.twitter.com/en/docs/twitter-api
:target: https://developer.x.com/en/docs/twitter-api
:alt: v2

.. image:: https://github.com/sns-sdks/python-twitter/workflows/Test/badge.svg
Expand All @@ -24,15 +24,15 @@ A simple Python wrapper for Twitter API v2 :sparkles: :cake: :sparkles:.
Introduction
============

Twitter has published new version `Twitter API V2 <https://twitter.com/TwitterDev/status/1293593516040269825>`_ for developer at Aug 13, 2020.
Twitter has published new version `Twitter API V2 <https://x.com/TwitterDev/status/1293593516040269825>`_ for developer at Aug 13, 2020.

This library provides a service to easily use this new version Twitter API.

=============
Documentation
=============

You can get all API descriptions `Twitter API v2 Documentation <https://developer.twitter.com/en/docs/twitter-api>`_.
You can get all API descriptions `Twitter API v2 Documentation <https://developer.x.com/en/docs/twitter-api>`_.

Docs for this library on `here <https://sns-sdks.github.io/python-twitter/>`_

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ So, This will show you how to obtain user access tokens through the 3-legged OAu

At the beginning, You need a Twitter app, and enable the `3-legged OAuth`.

You can get more information at the [official Documentation](https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens).
You can get more information at the [official Documentation](https://developer.x.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens).

If you're ready, now let's get started do a simple example with this library.

Expand All @@ -30,7 +30,7 @@ Now you can get the url for user to do authenticate,

```python
api.get_authorize_url()
# https://api.twitter.com/oauth/authorize?oauth_token=NPcudxy0yU5T3tBzho7iCotZ3cnetKwcTIRlX0iwRl0
# https://api.x.com/oauth/authorize?oauth_token=NPcudxy0yU5T3tBzho7iCotZ3cnetKwcTIRlX0iwRl0
```
Upon successful authentication, your callback_url would receive a request containing the oauth_token and oauth_verifier parameters.

Expand All @@ -51,5 +51,5 @@ Now the api instance will have the user authorization. You can use this to manag

!!! tip "Note"

If you have any confusion, you need to read the [Get user access token](https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens) first.
If you have any confusion, you need to read the [Get user access token](https://developer.x.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens) first.

4 changes: 2 additions & 2 deletions docs/docs/authorization_oauth2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Once you have got the request access for `OAuth2.0`, your app will have the `Client ID` to do `authorization` for `OAuth2.0`.

You can get more information at the [documentation](https://developer.twitter.com/en/docs/twitter-api/oauth2) and the [community content](https://twittercommunity.com/t/announcing-oauth-2-0-general-availability/163555).
You can get more information at the [documentation](https://developer.x.com/en/docs/twitter-api/oauth2) and the [community content](https://twittercommunity.com/t/announcing-oauth-2-0-general-availability/163555).

If you're ready, now let's get started do a simple example with this library.

Expand Down Expand Up @@ -32,7 +32,7 @@ You need save the `code_verifier` for generate access token.

```python
authorization_url, code_verifier, state = api.get_oauth2_authorize_url()
#('https://twitter.com/i/oauth2/authorize?response_type=code&client_id=client_id&redirect_uri=https%3A%2F%2Flocalhost%2F&scope=users.read+tweet.read&state=HVLpccax4G57jMJu1yddJtP55HYMQA&code_challenge=jntz4xjHJ0XHzWA7_Wa6rrA8zHwu4qPZt2MQsv6&code_challenge_method=S256',
#('https://x.com/i/oauth2/authorize?response_type=code&client_id=client_id&redirect_uri=https%3A%2F%2Flocalhost%2F&scope=users.read+tweet.read&state=HVLpccax4G57jMJu1yddJtP55HYMQA&code_challenge=jntz4xjHJ0XHzWA7_Wa6rrA8zHwu4qPZt2MQsv6&code_challenge_method=S256',
# '01wNLFIFeh310NpRLt837gcrvK1JqFrFvoYFU0DnH',
# 'HVLpccax4G57jMJu1yddJtP55HYMQA')
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A Python wrapper around for Twitter API V2 :sparkles: :cake: :sparkles:.

## Introduction

Twitter has published new version [Twitter API V2](https://twitter.com/TwitterDev/status/1293593516040269825) for developer at Aug 13, 2020.
Twitter has published new version [Twitter API V2](https://x.com/TwitterDev/status/1293593516040269825) for developer at Aug 13, 2020.

So this library provides a Python interface for this version API. Library work on Python 3.6+.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/compliance/batch_compliance.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
These batch compliance endpoints allow you to upload large datasets of Tweet or user IDs to retrieve their compliance status in order to determine what data requires action in order to bring your datasets into compliance. Please note, use of the batch compliance endpoints is restricted to aforementioned use cases, and any other purpose is prohibited and may result in enforcement action.

You can get more information at [batch compliance docs](https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/introduction).
You can get more information at [batch compliance docs](https://developer.x.com/en/docs/twitter-api/compliance/batch-compliance/introduction).

Typically, there are 4 steps involved in working with this endpoint:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/direct-messages/direct-messages-lookup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Direct Messages enable private conversations on Twitter. Direct Messages are one of the most popular features of Twitter, with a wide variety of use cases. These use cases range from group chats among friends to powering customer support for brands around the world. New v2 versions of Direct Messages endpoints will be introduced in stages, and this first stage includes fundamental endpoints for creating Direct Messages and listing Direct Message conversation events. For the first time, the Twitter API v2 supports group conversations.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/direct-messages/lookup/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/direct-messages/lookup/introduction)

### Get all messages in a 1-1 conversation

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/direct-messages/manage-direct-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Direct Messages enable private conversations on Twitter. Direct Messages are one of the most popular features of Twitter, with a wide variety of use cases. These use cases range from group chats among friends, to powering customer support for brands around the world. New v2 versions of Direct Messages endpoints will be introduced in stages, and this first stage includes fundamental endpoints for creating Direct Messages and listing Direct Message conversation events. For the first time, the Twitter API v2 supports group conversations.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/direct-messages/manage/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/direct-messages/manage/introduction)


### Create a message in a 1-1 conversation with the participant
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/usage/lists/list-follows.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

List follows lookup group has two available endpoints. You are able to retrieve details on followers of a specified List and get data on which Lists a user follows. These endpoints can be used to enable people to curate and organize Tweets based on what type of Lists other users are following.

You can use either [OAuth 1.0a User Context](https://developer.twitter.com/en/docs/authentication/oauth-1-0a) or [OAuth 2.0 Bearer Token](https://developer.twitter.com/en/docs/authentication/oauth-2-0) to authenticate to these endpoints.
You can use either [OAuth 1.0a User Context](https://developer.x.com/en/docs/authentication/oauth-1-0a) or [OAuth 2.0 Bearer Token](https://developer.x.com/en/docs/authentication/oauth-2-0) to authenticate to these endpoints.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/list-follows/introduction)

### Get list's followers

Expand All @@ -30,7 +30,7 @@ The manage List follows endpoints allow you to follow and unfollow a List on beh

For these endpoints, there are two methods available: POST and DELETE. The POST method allows you to follow a List, and the DELETE method allows you to delete a List.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/list-follows/introduction)

### Follow a list

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/usage/lists/list-lookup.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
~~This List lookup group has two available endpoints. You are able to retrieve a specified List by ID and get details on user-owned Lists. With the Lists endpoints, you can build solutions that enable people to curate and organize Tweets based on preferences, interests, groups, or topics.

You can use either [OAuth 1.0a User Context](https://developer.twitter.com/en/docs/authentication/oauth-1-0a) or [OAuth 2.0 Bearer Token](https://developer.twitter.com/en/docs/authentication/oauth-2-0) to authenticate to these endpoints. If you choose to use [OAuth 1.0a User Context](https://developer-staging.twitter.com/en/docs/authentication/oauth-1-0a), use the Access Tokens associated with a user that has authorized your App. You can generate Access Tokens using the [3-legged OAuth flow](https://developer-staging.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens).
You can use either [OAuth 1.0a User Context](https://developer.x.com/en/docs/authentication/oauth-1-0a) or [OAuth 2.0 Bearer Token](https://developer.x.com/en/docs/authentication/oauth-2-0) to authenticate to these endpoints. If you choose to use [OAuth 1.0a User Context](https://developer-staging.x.com/en/docs/authentication/oauth-1-0a), use the Access Tokens associated with a user that has authorized your App. You can generate Access Tokens using the [3-legged OAuth flow](https://developer-staging.x.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens).

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/list-lookup/introduction)

## Lookup a specific list by ID

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/usage/lists/list-members.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## List members lookup
Members lookup group has two available endpoints. You are able to retrieve details on members of a specified List and see which Lists a user is a member of. These endpoints can be used to enable people to curate and organize new Lists based on the membership information.

You can use either [OAuth 1.0a User Context](https://developer.twitter.com/en/docs/authentication/oauth-1-0a) or [OAuth 2.0 Bearer Token](https://developer.twitter.com/en/docs/authentication/oauth-2-0) to authenticate to these endpoints.
You can use either [OAuth 1.0a User Context](https://developer.x.com/en/docs/authentication/oauth-1-0a) or [OAuth 2.0 Bearer Token](https://developer.x.com/en/docs/authentication/oauth-2-0) to authenticate to these endpoints.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/list-members/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/list-members/introduction)

### Get list's members

Expand All @@ -30,7 +30,7 @@ The manage List members endpoints allow you to add and remove members to a List

For these endpoints, there are two methods available: POST and DELETE. The POST method allows you to add a member to a List, and the DELETE method allows you to remove a member from a List.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/list-members/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/list-members/introduction)

### Add member to a list

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/usage/lists/list-tweets-lookup.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
List Tweets lookup has one available endpoint to retrieve Tweets from a specified List. With this endpoint, you can build solutions that enable users to customize, organize and prioritize the Tweets they see in their timeline.

You can use either [OAuth 1.0a User Context](https://developer.twitter.com/en/docs/authentication/oauth-1-0a) or [OAuth 2.0 Bearer Token](https://developer.twitter.com/en/docs/authentication/oauth-2-0) to authenticate to these endpoints. If you choose to use [OAuth 1.0a User Context](https://developer-staging.twitter.com/en/docs/authentication/oauth-1-0a), use the Access Tokens associated with a user that has authorized your App. You can generate Access Tokens using the [3-legged OAuth flow](https://developer-staging.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens).
You can use either [OAuth 1.0a User Context](https://developer.x.com/en/docs/authentication/oauth-1-0a) or [OAuth 2.0 Bearer Token](https://developer.x.com/en/docs/authentication/oauth-2-0) to authenticate to these endpoints. If you choose to use [OAuth 1.0a User Context](https://developer-staging.x.com/en/docs/authentication/oauth-1-0a), use the Access Tokens associated with a user that has authorized your App. You can generate Access Tokens using the [3-legged OAuth flow](https://developer-staging.x.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens).

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/list-tweets/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/list-tweets/introduction)

## Lookup Tweets from a specified List

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/lists/manage-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For these endpoints, there are three methods available: POST, DELETE and PUT. Th

There is a user rate limit of 300 requests per 15 minutes for all three endpoints.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/manage-lists/introduction)

Note that you can create up to 1000 Lists per account.

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/usage/lists/pinned-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For these endpoints, there are two methods available: POST and DELETE. The POST

There is a user rate limit of 50 requests per 15 minutes for both endpoints.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/pinned-lists/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/pinned-lists/introduction)

### Pin a list

Expand All @@ -30,9 +30,9 @@ my_api.unpin_list(user_id=my_api.auth_user_id, list_id="ID for list to unpin")

Pinned List lookup has one available endpoint that allows you to retrieve an authenticated user's pinned Lists. There is a rate limit of 15 requests per 15 minutes for this endpoint.

Since you are making requests on behalf of a user with all pinned List endpoints, you must authenticate with [OAuth 1.0a User Context](https://developer-staging.twitter.com/en/docs/authentication/oauth-1-0a) and use the Access Tokens associated with a user that has authorized your App. You can generate Access Tokens using the [3-legged OAuth flow](https://developer-staging.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens).
Since you are making requests on behalf of a user with all pinned List endpoints, you must authenticate with [OAuth 1.0a User Context](https://developer-staging.x.com/en/docs/authentication/oauth-1-0a) and use the Access Tokens associated with a user that has authorized your App. You can generate Access Tokens using the [3-legged OAuth flow](https://developer-staging.x.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens).

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/lists/pinned-lists/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/lists/pinned-lists/introduction)

### Get user pinned lists

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/media-upload/chunked-upload.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Chunked upload is the recommended method for uploading media files. It allows you to upload media files up to 512MB. The chunked upload endpoint can be used to upload both images and videos.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload-init).
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload-init).

follow the steps below to upload a video by chunked upload:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/media-upload/simple-upload.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The simple upload endpoint can only be used to upload images(gifs).

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload)

follow the steps below to upload an image:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/spaces/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This endpoint allows you to search Spaces by their title, and to filter results

The endpoint accepts one or more keywords as a query. Its results can be filtered by the status of a Space (live or scheduled). By default, a request will return both live and scheduled Spaces that match the specified query.

You can get more information at [search docs](https://developer.twitter.com/en/docs/twitter-api/spaces/search/introduction).
You can get more information at [search docs](https://developer.x.com/en/docs/twitter-api/spaces/search/introduction).

## Search spaces

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/spaces/spaces-lookup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The Spaces lookup endpoints help you lookup live or scheduled Spaces, and enable you to build discovery experiences to give your users ways to find Spaces they may be interested in.
You can get more information at [Lookup docs](https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/introduction).
You can get more information at [Lookup docs](https://developer.x.com/en/docs/twitter-api/spaces/lookup/introduction).

There have multiple methods for get spaces data by api.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/trends/trends.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The Trends lookup endpoint allow developers to get the Trends for a location, specified using the where-on-earth id (WOEID).

**Note:** WOEID is a legacy identifier created by Yahoo and has been deprecated. X API uses the numeric value to identify town and country trend locations.
Reference our legacy [blog post](https://blog.twitter.com/engineering/en_us/a/2010/woeids-in-twitters-trends.html), or [archived data](https://archive.org/details/geoplanet_data_7.10.0.zip0.)
Reference our legacy [blog post](https://blog.x.com/engineering/en_us/a/2010/woeids-in-twitters-trends.html), or [archived data](https://archive.org/details/geoplanet_data_7.10.0.zip0.)

### Get trends

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/tweets/bookmarks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Bookmarks are a core feature of the Twitter app that allows you to “save” Tweets and easily access them later. With these endpoints, you can retrieve, create, delete or build solutions to manage your Bookmarks via the API.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/tweets/bookmarks/introduction)

## Manage Bookmarks

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/tweets/likes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ The manage Likes endpoints enable you to like or unlike a specified Tweet on beh

For this endpoint group, there are two methods available POST and DELETE. The POST method allows you to like a Tweet, and the DELETE method will enable you to unlike a Tweet.

You can get more information for this at [docs](https://developer.twitter.com/en/docs/twitter-api/tweets/likes/introduction)
You can get more information for this at [docs](https://developer.x.com/en/docs/twitter-api/tweets/likes/introduction)

## likes

Expand Down
Loading