anyx
Use X from any browser, as any of your accounts. From the command line or from Python. No API keys.
pip install anyx && playwright install chromium
anyx accounts add yourhandle # log in once in the window that opens
anyx tweet https://x.com/jack/status/20
anyx drives a real browser and reads the same data X's web app loads, so you get what the app shows: views, likes, reposts, replies, quotes, bookmarks, full text, media and quoted posts.
What it does
read tweet thread quotes user posts search home trends notifications
bookmarks likes followers following analytics shot
post post: plain, quote, reply, thread, up to 4 images with alt text or a video,
poll, who can reply, scheduled, draft
delete scheduled (list, move, delete) drafts (list, delete)
engage like unlike retweet unretweet bookmark unbookmark pin unpin
people follow unfollow mute unmute block unblock
lists lists list create | add | remove | posts | members | delete
groups community (info, posts) join leave
chat chat setup chats messages dm
account profile settings (read all; change 14, and the @handle) muted (words)
accounts add login import harvest set check list
anyx posts nasa -n 20
anyx search "from:nasa min_faves:1000" --tab top
anyx thread https://x.com/jack/status/20
anyx trends --tab news
anyx --as alice post "hello" --media cat.jpg --alt "a cat on a desk"
anyx --as alice post "agreed" --quote https://x.com/jack/status/20
anyx --as alice post "1/3" --thread "2/3" "3/3"
anyx --as alice post "which?" --poll "this|that" --poll-days 1
anyx --as alice post "later" --at "2026-12-01 09:00"
anyx --as alice scheduled
anyx --as bob like https://x.com/jack/status/20
anyx --as bob dm alice "hi"
anyx --as alice,bob,carol follow nasa # each account, in parallel
anyx --as all --wait notifications -n 5 # every account; sleep through rate limits
anyx --json user jack | jq .followers
anyx <command> --help shows how to call one command. --json prints JSON instead of text. --show opens a visible window. --as a,b,c (or all) runs the command as each account, -j at a time. --wait sleeps until X lifts a rate limit, then carries on. Times are local, in --at and in what anyx prints.
Each account's browser stays open between commands; anyx status lists them and anyx stop closes them.
Scheduled posts are sent by X itself, so your machine can be off by then. X takes them at least 5 minutes ahead.
Accounts
anyx accounts login - --file creds.tsv # log every account in
anyx accounts login alice --file creds.tsv # just one
anyx accounts add alice # log in by hand, when X asks for more than a password
anyx accounts harvest --browser adspower --profile work # adopt accounts already logged into that profile
anyx accounts import alice cookies.json --browser chrome # cookies exported from that browser
anyx accounts check all # ok, expired, locked, suspended, rate_limited, in search?
anyx accounts list
creds.tsv has one account per line: handle<TAB>password<TAB>totp-secret, the last column only for accounts with two-factor on. Cookies used in a browser other than the one they were made in work, but X sometimes refuses things from them.
Browsers
| browser | what it is |
|---|---|
chromium |
Playwright's Chromium, one profile per account. The default. |
chrome |
Your installed Google Chrome. |
cdp |
A browser you started with --remote-debugging-port. |
adspower |
An AdsPower profile. |
anyx config set adspower.key KEY
anyx accounts set bob --browser adspower --profile x-bob
anyx accounts set carol --browser cdp --cdp http://127.0.0.1:9222
anyx accounts set dave --proxy http://user:pass@host:port
A browser can be one you use yourself, with accounts already logged in. anyx works in a tab of its own and leaves yours alone. When it switches the browser to another account it does it the way X's account switcher does, so every account stays logged in and you can still switch by hand. While you are using the browser (it shows an account anyx did not put there, or you have x.com open in another tab), anyx stops instead of switching; --force switches anyway. AdsPower profiles are started with their window; anyx config set adspower.headless true starts them without.
Chat
anyx --as alice chat setup --pin 1234
X asks each account for its 4-digit chat passcode on every new browser; anyx enters the one you gave it. If X says it is wrong, anyx stops instead of trying again, since X destroys the chat keys after too many wrong tries. Messages only go between accounts that follow each other, or to accounts that accept requests (anyx settings set dms everyone).
Pace
Off by default:
anyx config set pace.page [2,5] # pause 2-5 s before each page change
anyx config set pace.write [6,14] # and 6-14 s before each write
anyx config set rest true # stop using an account for a while after X pushes back
Python
import anyx
with anyx.Session("alice") as x:
t = x.tweet("https://x.com/jack/status/20")
print(t["views"], t["likes"], t["text"])
x.post("hello", quote=t["url"])
Every command is a method of the same name on Session, and returns what --json prints.
Exit codes
| code | meaning |
|---|---|
| 0 | done (or already so: liking a liked post returns already) |
| 2 | bad arguments |
| 3 | the account is logged out or locked |
| 4 | the browser showed a different account; nothing was done |
| 5 | X changed its page |
| 6 | rate limited |
| 7 | the post or account does not exist or is not visible |
| 8 | X did not confirm the change, or refused it (its reason is printed) |
Tested on macOS, with X shown in Japanese and in English.
License
MIT
Metadata
Release files for anyx 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| anyx-0.1.4.tar.gz | 60.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anyx-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 126.6 kB
Release files / anyx-0.1.4.tar.gz
| Download URL | anyx-0.1.4.tar.gz |
|---|---|
| Size | 60.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3412ac97ff8f45f490449817f71bf561c5f75b01938b297bcf3f4ada808f749
|
|
BLAKE2b-256 checksum How to use checksums |
2713d8627a51293016bac90b191eb0d68be8ab1d6506a85724fb37e9b737fd2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0
|
Release files / anyx-0.1.4-py3-none-any.whl
| Download URL | anyx-0.1.4-py3-none-any.whl |
|---|---|
| Size | 66.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62624cd020057a2feb2325d37e0167c359621df24092c5445f6262862cdf9e12
|
|
BLAKE2b-256 checksum How to use checksums |
42ab12a90c96447d6c9b1dfc803efc9492f870e966b121d16725566bcdfb7d80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0
|
Security for anyx 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.