Metadata-Version: 2.1
Name: apidance
Version: 0.4.0
Summary: https://apidance.pro/ community python sdk
License: MIT
Author: script-money
Author-email: hello@script.money
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: httpx (>=0.25.2,<0.26.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Description-Content-Type: text/markdown

# Apidance SDK

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

## Installation

```bash
pip install apidance
```

## Configuration

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

```env
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:

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

## Usage

> Check out the [examples](https://github.com/script-money/apidance/tree/main/examples)

```python
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

