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
X_AUTH_TOKEN=your_x_auth_token_here # Required for reply/like actions
Get your API key from https://apidance.pro
You can find your X_AUTH_TOKEN in your browser cookies when logged into x.com:
- Open x.com and log in
- Open browser developer tools (F12 or right-click -> Inspect)
- Go to Application/Storage -> Cookies -> x.com
- 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")
MCP server
FillSet config file
{
"mcpServers": {
"apidance": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/apidance-sdk",
"run",
"mcp_server.py"
]
}
}
}
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)
- Create tweets and reply to existing tweets
- Create note tweets (long rich text tweet, requires Premium+)
- Host as mcp server
Models
The SDK provides two main data models:
Tweet: Represents a Twitter post with all its metadataUser: Contains detailed user information including profile data, stats, and verification status
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apidance-0.6.2.tar.gz.
File metadata
- Download URL: apidance-0.6.2.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ffbd03778933f3c623349f19d879d22485c0412f98da3f611e5bab37835ef19
|
|
| MD5 |
70944112269198499a2df86a9c35e1a5
|
|
| BLAKE2b-256 |
cbaee254c0a1c3dd84285b2723476d2c81a44f24121040fcc38a894d79c900f8
|
File details
Details for the file apidance-0.6.2-py3-none-any.whl.
File metadata
- Download URL: apidance-0.6.2-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd01876e6b5944d6f5970374a27b8c04e35f1869192779ef044ff0edae1c52d2
|
|
| MD5 |
6a908ad74b63513ba6c34f17ae7a8d1a
|
|
| BLAKE2b-256 |
faa45378d9b4bf7c1824a5572d359f0c0d62d9dc43455a22ac02db2536630820
|