Skip to main content

Unofficial Twitter API In Python

Project description

Unofficial Twitter API In Python

Overview

This project is an unofficial Python wrapper for the Twitter API, enabling developers to easily access and retrieve data from Twitter without the need for Cookies or Proxies.

GitHub Repo stars GitHub forks Vistors License

Installation

To install the package, use pip:

pip install twittapi

Usage

Here's a basic example of how to use the API:

First, you need to get the X_RAPIDAPI_KEY. See more: How to get X_RAPIDAPI_KEY?.

from twitter_api import TwitterAPI

X_RAPIDAPI_KEY = '<YOUR_X_RAPIDAPI_KEY>'
twitter = TwitterAPI(X_RAPIDAPI_KEY)

# Get user detail
user_detail = twitter.get_user_detail(username='taylorswift13')
print(user_detail)

# Get user tweets
user_id = user_detail['user']['result']['rest_id']
tweets = twitter.get_user_tweets(user_id=user_id)
print(tweets)

How to get X_RAPIDAPI_KEY?

To get your X_RAPIDAPI_KEY, follow these steps:

  1. Go to the RapidAPI website: RapidAPI

  2. Sign up for a free account or log in if you already have one.

  3. Navigate to the Twitter API page: https://rapidapi.com/Lundehund/api/twitter-x-api

  4. Subscribe to the API by selecting a pricing plan that suits your needs.

  5. After subscribing, you will be able to find your API key in the "App" tab section of your RapidAPI dashboard.

where-to-find-x-rapidapi-key

  1. Copy the API key and use it to initialize the TwitterApi class in your code.

Examples

Go to the /examples folder to view more snippet code and example data.

Contributing

Contributions are welcome! If you find this project helpful, please consider starring the repository on GitHub ⭐️

Additional Resources

Here are some additional resources you might find helpful:

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twittapi-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twittapi-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file twittapi-0.1.0.tar.gz.

File metadata

  • Download URL: twittapi-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for twittapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10cc4c07b3c32a6d26556de3beea3f163e6ad8d3ca46f3bbd7f8933425b2247d
MD5 d5ebae46652c691e7ee26a317128c28f
BLAKE2b-256 0759bea2ca3e713048ac3e9ded7c391d840fe558cd39891b339905c593944852

See more details on using hashes here.

File details

Details for the file twittapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: twittapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for twittapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46f338c47c51548be86ce51aa1c1721b473d6915a1c32aedfc001d449105e238
MD5 9827dd4db1a8a403469452189fc390ee
BLAKE2b-256 f80060db931360fe4f89c0e9a10b8c334abd5c87a1ebdac4fba8b763548b64d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page