X Client transaction server

July 13, 2025 ยท View on GitHub

Test workflow

X Client transaction server

Wrapper of XClientTransaction in a Flask server. ๐Ÿฆ

๐ŸŒ Public instance: https://x-client-transaction-id-generator.xyz

๐Ÿ”ง Setup

python3 -mvenv .venv
source ./.venv/bin/activate
pip install -r requirements.txt
python generate_secret_token.py

Launch:

python app.py

๐Ÿ“š API Reference

/generate-x-client-transaction-id

Type: GET

Get a x-client-transaction-id header value.

Parameters:

  • path: Path to the x API.
    • Required
    • Example value: /i/api/graphql/1VOOyvKkiI3FMmkeDNxM9A/UserByScreenName

Returned value

Type: JSON

{"x-client-transaction-id": "<transaction_id>"}

Caution

If path is missing, returns code 400 with response:

{"error": "Missing required parameter 'path'"}

Example

/generate-x-client-transaction-id?path=/i/api/graphql/1VOOyvKkiI3FMmkeDNxM9A/UserByScreenName

/reset-session

Type: GET

Reset the session managing the creation of transaction IDs.

It might be useful to call this once, if the generated x-client-transaction-id don't work anymore

Parameters:

Returned value

Type: JSON

{"message": "Session reinitialized successfully"}

Caution

If token is missing, or invalid, returns 401 error with the following body:

{"error": "Invalid token"}

Example

/reset-session?token=64nHYRvXaWElVBMHPp6xTedpGuzelTgrhOft4ESrzvTQ4whuQKeUO_i