https://github.com/ztgx/xplore
Xplore is a scraper for Twitter/X without using API in Rust.
https://github.com/ztgx/xplore
automation bot rust scraper scraping twitter twitter-api twitter-bot twitter-client x x-client
Last synced: 10 months ago
JSON representation
Xplore is a scraper for Twitter/X without using API in Rust.
- Host: GitHub
- URL: https://github.com/ztgx/xplore
- Owner: zTgx
- License: mit
- Created: 2025-02-25T13:30:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-11T16:36:24.000Z (12 months ago)
- Last Synced: 2025-08-16T01:34:35.170Z (10 months ago)
- Topics: automation, bot, rust, scraper, scraping, twitter, twitter-api, twitter-bot, twitter-client, x, x-client
- Language: Rust
- Homepage:
- Size: 293 KB
- Stars: 17
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xplore
X scraper for Rust
[](https://crates.io/crates/xplore)


>> 💥 PRs are welcome.
>> ❗We are still in the early development phase, so please be aware that the interfaces may evolve as we continue to refine the project.
## Features
- Authentication with cookies
- Comprehensive user profile management
- Timeline retrieval
- Tweet interactions (like, retweet, post)
- Advanced search capabilities
- User relationship management (follow/unfollow)
## Installation
```toml
[dependencies]
xplore = "0.1"
```
## Usage
Two method to authenticate with Cookie:
* By using `login`
```rust
let mut xplore = Xplore::new(None).await.unwrap();
xplore.login(username, password, email, two_factor_secret).await;
```
OR
* By using `set_cookie`
```rust
let mut xplore = Xplore::new(None).await.unwrap();
let cookie = env::var("X_COOKIE_STRING").expect("X_COOKIE_STRING");
xplore.set_cookie(&cookie).await;
```
---
> [!IMPORTANT]
> **How to Get Request Cookie for Authentication**
>
> **Steps to Retrieve Cookie:**
> 1. Open Chrome Developer Tools:
> - Press `F12` or `Fn+F12` (depending on your keyboard)
> - Alternatively: Right-click → "Inspect" → "Network" tab
>
> 2. Locate the Request:
> - Filter requests and select `user_flow.json`
> - Navigate to the "Headers" section
>
> 3. Copy Cookie Value:
> - Under "Request Headers" → Find the "Cookie" field
> - Select and copy the entire cookie string
>
> 4. Configure Environment:
> - Paste the copied value in your `.env` file:
> ```env
> X_COOKIE_STRING=your_copied_cookie_value_here
> ```
>
> **Note:** This cookie is used for authentication - keep it secure and never commit to version control.
---
### A quick start
```rust
use dotenv::dotenv;
use std::env;
use xplore::Xplore;
#[tokio::main]
async fn main() {
dotenv().ok();
let mut xplore = Xplore::new(None).await.unwrap();
let cookie = env::var("X_COOKIE_STRING").expect("X_COOKIE_STRING");
xplore.set_cookie(&cookie).await;
let screen_name = "zTgx5"; // Replace with the desired screen name
println!("Getting profile for: {screen_name}");
let profile = xplore.get_profile(screen_name).await.expect("Failed to get profile");
println!("Profile: {profile:#?}");
}
```
## Star History
[](https://www.star-history.com/#zTgx/xplore&Date)
## License
MIT