Skip to main content

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.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anyx 0.1.5
File Size Uploaded Provenance
anyx-0.1.5.tar.gz 62.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for anyx 0.1.5
File Interpreter ABI Platform
anyx-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 130.7 kB

Release files / anyx-0.1.5.tar.gz

Download URL anyx-0.1.5.tar.gz
Size 62.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a20a9e0a09d9e344349467bd538df9abe3a78e339cd2df3f191773cf011fa9d5
BLAKE2b-256 checksum
How to use checksums
3303ae7f82828ba8bd68c75fde9ca1de97e3aefb02dd63aee4a0e207582541d8
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.5-py3-none-any.whl

Download URL anyx-0.1.5-py3-none-any.whl
Size 68.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8af881ee28319f46bb1e26f7a4e1d7ec6df0885e5ea0250fdc05f6f50d4f35a0
BLAKE2b-256 checksum
How to use checksums
80ad9cd4a3886c2fcb6dfc742924757cfef1277daa68b55d676daf176c707aa1
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.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page