Giter Site home page Giter Site logo

aimadnet / twttrapi-python Goto Github PK

View Code? Open in Web Editor NEW
50.0 2.0 4.0 14 KB

TwttrAPI Python - Unofficial Twitter API

Home Page: https://twttrapi.com

License: MIT License

Python 100.00%
twitter twitter-api twitter-bot twitter-client twitter-login twitter-login-demo twitter-login-integration twitter-login-script

twttrapi-python's Introduction

TwttrAPI Python - Unofficial Twitter API

A Python API wrapper for TwttrAPI, an unofficial Twitter API available on RapidAPI, which is built using Twitter's mobile API.

https://rapidapi.com/twttrapi-twttrapi-default/api/twttrapi

Installation

Copy the twttrapi.py file into your project directory.

Usage

Import the TwttrAPIClient class and instantiate it with your RapidAPI key:

from twttrapi import TwttrAPIClient

api_key = "your_rapidapi_key_here"
client = TwttrAPIClient(api_key)

Methods

Here is a list of methods available in the TwttrAPIClient class:

  • get_tweet(tweet_id)
  • get_tweet_conversation(tweet_id)
  • user_tweets(username=None, user_id=None, cursor=None)
  • user_media(username=None, user_id=None, cursor=None)
  • user_likes(username=None, user_id=None, cursor=None)
  • for_you_timeline(cursor=None)
  • following_timeline(cursor=None)
  • create_tweet(tweet_text, attachment_url=None, in_reply_to_tweet_id=None, media_id=None)
  • delete_tweet(tweet_id)
  • get_user(username=None)
  • user_followers(username=None, user_id=None, cursor=None)
  • user_following(username=None, user_id=None, cursor=None)
  • search_suggestions(query, cursor=None)
  • search_top(query, cursor=None)
  • search_latest(query, cursor=None)
  • search_users(query, cursor=None)
  • search_images(query, cursor=None)
  • search_videos(query, cursor=None)
  • login_email_username(username_or_email, password)
  • login_2fa(login_data, response)
  • logout()
  • follow_user(username=None, user_id=None)
  • unfollow_user(username=None, user_id=None)
  • favorite_tweet(tweet_id)
  • unfavorite_tweet(tweet_id)
  • retweet_tweet(tweet_id)
  • unretweet_tweet(tweet_id)
  • get_dm_conversations(cursor=None)
  • get_dm_conversation(username=None, user_id=None, cursor=None)
  • send_dm(message, to_user_name=None, to_user_id=None, media_id=None)
  • upload_image(image_url)

For more information on each method and its parameters, please refer to the twttrapi.py file.

Example

Here's an example on how to use the API wrapper:

from twttrapi import TwttrAPIClient

api_key = "your_rapidapi_key_here"
client = TwttrAPIClient(api_key)

# Get a tweet by its ID
tweet_id = "1652849795336159233"
tweet = client.get_tweet(tweet_id)
print(tweet)

twttrapi-python's People

Contributors

aimadnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

twttrapi-python's Issues

Proxy error

Where should i find twttr-proxy?
I added http proxy and it give me api error , what ia the problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.