--- id: xclienttransaction version: "1.0.3" license: MIT license_treatment: permissive maintenance: active --- # xclienttransaction — Twitter X-Client-Transaction-Id generator written in python. License: permissive · Maintenance: active · Downloads: 243.0K/mo ## What it is and what it does XClientTransaction generates the X-Client-Transaction-ID header required to authenticate requests to X.com APIs. The package implements a reverse-engineered transaction ID generation algorithm and provides utilities to create valid transaction IDs for specific HTTP methods and API paths. It works by parsing the X.com home page and an ondemand.s file to extract cryptographic material, then uses that material to compute transaction IDs. The package supports both synchronous and asynchronous workflows. It includes helper functions to fetch and parse necessary X.com responses, handle domain migration from twitter.com to x.com, and generate properly formatted headers. The single runtime dependency is beautifulsoup4 for HTML parsing, keeping the installation lightweight. Use it for: - Automating X.com API requests that require valid X-Client-Transaction-ID headers without using official SDK authentication. - Building bots or scrapers that interact with X.com endpoints and need to satisfy transaction ID validation. - Reverse-engineering or testing X.com's API authentication mechanisms in security research contexts. - Integrating X.com API access into applications where standard OAuth flows are unavailable or impractical. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates X-Client-Transaction-ID headers for authenticating requests to X.com APIs by implementing the reverse-engineered transaction ID generation algorithm. Yes, if you need to make authenticated requests to X.com APIs outside official SDK channels. The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. Be aware that reverse-engineered authentication mechanisms can break if X.com changes its algorithms. ## Install pip install xclienttransaction uv add xclienttransaction poetry add xclienttransaction ## Installing xclienttransaction Before you install: Low install friction with a single runtime dependency (beautifulsoup4). Actively maintained with recent commits; marked Production/Stable. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both commercial and personal projects. Quickstart: pip install xclienttransaction from xclienttransaction import ClientTransaction from urllib.parse import urlparse ct = ClientTransaction(home_page_response=home_page_response, ondemand_file_response=ondemand_file_response) transaction_id = ct.generate_transaction_id(method='POST', path='/i/api/1.1/jot/client_event.json') Requires fetching X.com home page and ondemand.s file responses first to initialize ClientTransaction; these responses must be parsed and passed to the constructor. Verify before relying: - Whether the reverse-engineered algorithm remains stable as X.com updates its authentication mechanisms. - Performance characteristics when generating transaction IDs at scale or high frequency. - Compatibility with different X.com API versions and endpoints beyond those shown in examples. - Whether use of this package complies with X.com's terms of service. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 243.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags twitter x client transaction id, x.com api authentication header, twitter tid generator, x api client transaction, twitter api header generation, x.com request authentication, twitter-api, reverse-engineering, authentication [View on SkillFed](https://skillfed.io/packages/xclienttransaction) · [View on PyPI](https://pypi.org/project/xclienttransaction/)