You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since this project works through an authorized API, accounts need to be added. You can register and add an account yourself. You can also google sites that provide these things.
39
+
This project requires authorized X/Twitter accounts to work with the API. You have two options:
40
40
41
-
The email password is needed to get the code to log in to the account automatically (via imap protocol).
41
+
1.**Create Your Own Account**: While you can register a new account on X/Twitter yourself, it's can be difficult due to strict verification processes and high ban rates.
2.**Use Ready Accounts**: For immediate access, you can get ready-to-use accounts with cookies from [our recommended provider](https://kutt.it/ueeM5f). Cookie-based accounts typically have fewer login issues.
44
+
45
+
For optimal performance and to avoid IP-based restrictions, we also recommend using proxies from [our provider](https://kutt.it/eb3rXk).
46
+
47
+
**Disclaimer**: While X/Twitter's Terms of Service discourage using multiple accounts, this is a common practice for data collection and research purposes. Use responsibly and at your own discretion.
46
48
47
49
```python
48
50
import asyncio
49
51
from twscrape importAPI, gather
50
52
from twscrape.logger import set_log_level
51
53
52
54
asyncdefmain():
53
-
api = API() # or API("path-to.db") - default is `accounts.db`
55
+
api = API() # or API("path-to.db") – default is `accounts.db`
await api.pool.login_all() # try to login to receive account cookies
69
+
64
70
# API USAGE
65
71
66
72
# search (latest tab)
@@ -311,21 +317,21 @@ So if you want to use proxy PER ACCOUNT, do NOT override proxy with env variable
311
317
312
318
_Note:_ If proxy not working, exception will be raised from API class.
313
319
314
-
## Environment variables
320
+
## Environment Variables
315
321
316
-
-`TWS_WAIT_EMAIL_CODE` – timeout for email verification code during login (default: `30`, in seconds)
317
-
-`TWS_RAISE_WHEN_NO_ACCOUNT` – raise `NoAccountError` exception when no available accounts right now, instead of waiting for availability (default: `false`, possible value: `false` / `0` / `true` / `1`)
322
+
-`TWS_PROXY` - global proxy for all accounts (e.g. `socks5://user:pass@127.0.0.1:1080`)
323
+
-`TWS_WAIT_EMAIL_CODE` - timeout for email verification code during login (default: `30`, in seconds)
324
+
-`TWS_RAISE_WHEN_NO_ACCOUNT` - raise `NoAccountError` exception when no available accounts, instead of waiting (default: `false`, values: `false`/`0`/`true`/`1`)
318
325
319
326
## Limitations
320
327
321
-
After 1 July 2023 Twitter [introduced new limits](https://x.com/elonmusk/status/1675187969420828672) and still continue to update it periodically.
322
-
323
-
The basic behaviour is as follows:
324
-
- the request limit is updated every 15 minutes for each endpoint individually
325
-
- e.g. each account have 50 search requests / 15 min, 50 profile requests / 15 min, etc.
328
+
X/Twitter regularly [updates](https://x.com/elonmusk/status/1675187969420828672) their rate limits. Current basic behavior:
329
+
- Request limits reset every 15 minutes for each endpoint individually
330
+
- Each account has separate limits for different operations (search, profile views, etc.)
326
331
327
-
API data limits:
328
-
-`user_tweets` & `user_tweets_and_replies` – can return ~3200 tweets maximum
332
+
API data limitations:
333
+
-`user_tweets` & `user_tweets_and_replies` - can return ~3200 tweets maximum
334
+
- Rate limits may vary based on account age and status
329
335
330
336
## Articles
331
337
-[How to still scrape millions of tweets in 2023](https://medium.com/@vladkens/how-to-still-scrape-millions-of-tweets-in-2023-using-twscrape-97f5d3881434)
0 commit comments