Skip to main content

https://apidance.pro/ community python sdk

Project description

Apidance SDK

A Python SDK for interacting with the Apidance API (https://apidance.pro/).

Installation

pip install apidance

Configuration

Create a .env file in your project root with your API credentials:

APIDANCE_API_KEY=your_api_key_here
AUTH_TOKEN=your_auth_token_here  # Required for reply/like actions

You can find your auth_token in your browser cookies when logged into x.com:

  1. Open x.com and log in
  2. Open browser developer tools (F12 or right-click -> Inspect)
  3. Go to Application/Storage -> Cookies -> x.com
  4. Find and copy the value of auth_token

Or provide the credentials directly when initializing the client:

client = TwitterClient(
    api_key="your_api_key_here",
    auth_token="your_auth_token_here"  # Required for reply/like actions
)

Usage

Check out the examples

from apidance import TwitterClient

# Initialize the client
client = TwitterClient()

# Search tweets
tweets = client.search_timeline(
    query="python",
)

# Get user information
user = client.get_user_by_screen_name("example")

users = client.get_following(user_id=user["id"])

# Get tweets from a list
list_tweets = client.get_list_latest_tweets(
    list_id="your_list_id",
)

# Reply to a tweet
client.create_tweet(
    text="Your reply text",
    reply_to_tweet_id="tweet_id_to_reply_to",
)

# Like a tweet
client.favorite_tweet(tweet_id="tweet_id_to_like")

Features

  • Search Twitter timeline with various filters (Latest, Top, People, Photos, Videos)
  • Get detailed user information by screen name
  • Fetch tweets from Twitter lists
  • Search Following
  • Reply to tweets (requires auth_token)
  • Like tweets (requires auth_token)

Models

The SDK provides two main data models:

  • Tweet: Represents a Twitter post with all its metadata
  • User: Contains detailed user information including profile data, stats, and verification status

License

MIT License

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

apidance-0.4.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

apidance-0.4.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file apidance-0.4.1.tar.gz.

File metadata

  • Download URL: apidance-0.4.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.8.18 Linux/6.8.0-1020-azure

File hashes

Hashes for apidance-0.4.1.tar.gz
Algorithm Hash digest
SHA256 5997786001af1ff9bfa4c494f175a4e2e63111db816c46639432ef7384083c9d
MD5 79b8f2fd693d240034d39d007a50248a
BLAKE2b-256 33d029e300f8f37604ecb84f03636fe0273ff7689b6406e23a40e589602fe560

See more details on using hashes here.

File details

Details for the file apidance-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: apidance-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.8.18 Linux/6.8.0-1020-azure

File hashes

Hashes for apidance-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e039160d4949cfa4c5cc7f1f26c688eb0831a856d53b800e279134b8ccc0bd2
MD5 aa33ca0c322c25b075211f1c75f6dff0
BLAKE2b-256 52f74a2241d7767b215e81736d05456d5608c85ad05fa27ddd18b152747b9d6e

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