{"repo":"xdevplatform/samples","free":true,"listed":false,"github":"https://github.com/xdevplatform/samples","clone":"git clone https://github.com/xdevplatform/samples.git","description":"Sample code for the X API v2 endpoints","language":"Python","stars":3199,"topics":["twitter","twitter-api","ruby","java","python","nodejs","javascript","twitter-api-v2"],"license":"Apache-2.0","category":"auth-billing-email","readme_excerpt":"X API v2 Sample Code Working code samples for the X API v2 in Python, JavaScript, Ruby, Java, and R. 📁 Repository Structure 🚀 Quick Start 1. Get API Credentials Sign up at the X Developer Portal. 2. Set Environment Variables For read-only operations (search, lookup): For user actions (post, like, repost, bookmark, etc.): For OAuth 1.0a (legacy endpoints): 3. Run an Example 📚 Examples by Category Category Python JavaScript Ruby Java R ---------- -------- ------------ ------ ------ --- Posts (search, create, delete, likes, reposts) ✅ ✅ ✅ ✅ ✅ Users (lookup, followers, following, blocks, mutes) ✅ ✅ ✅ ✅ ✅ Timelines (user, mentions, home) ✅ ✅ ✅ ✅ Streams (filtered, sampled) ✅ ✅ ✅ ✅ Lists (lookup, manage, members, follow) ✅ ✅ ✅ Spaces (lookup, search) ✅ ✅ ✅ ✅ Bookmarks ✅ ✅ ✅ Direct Messages ✅ Media Upload ✅ Compliance ✅ ✅ Usage ✅ ✅ ✅ 🔐 Authentication Type Use Case Env Vars ------ ---------- ---------- Bearer Token Read-only (search, lookup) BEARER TOKEN OAuth 2.0 PKCE User actions (post, like, repost, bookmark, mute, etc.) CLIENT ID , CLIENT SECRET OAuth 1.0a Legacy endpoints (if applicable) CONSUMER KEY , CONSUMER SECRET 🤖 For LLMs - llms.txt - Context file for AI assistants - api-index.json - Machine-readable endpoint catalog 🔗 Resources - X API Documentation - Developer Portal 📄 License Apache 2.0","default_branch":null,"files":null,"tree":[],"storefront":"/r/xdevplatform","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/xdevplatform/samples/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}