Skip to content

Commit 28d726b

Browse files
committed
Add AI & LLM resources page
1 parent 12c4e9d commit 28d726b

14 files changed

Lines changed: 877 additions & 184 deletions

File tree

docs.json

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,30 @@
2323
"developer-guidelines",
2424
"what-to-build",
2525
"make-your-first-request",
26-
"tools-and-libraries"
26+
{
27+
"group": "Tools & Libraries",
28+
"icon": "toolbox",
29+
"pages": [
30+
"tools-and-libraries",
31+
"tools/xurl",
32+
{
33+
"group": "SDKs (XDKs)",
34+
"pages": [
35+
"tools/python-xdk",
36+
"tools/typescript-xdk"
37+
]
38+
},
39+
{
40+
"group": "AI & LLM Resources",
41+
"pages": [
42+
"tools/ai-docs",
43+
"tools/llms-txt",
44+
"tools/skill-md",
45+
"tools/mcp"
46+
]
47+
}
48+
]
49+
}
2750
]
2851
},
2952
{
@@ -1071,7 +1094,7 @@
10711094
]
10721095
},
10731096
{
1074-
"tab": "Python SDK",
1097+
"tab": "Python XDK",
10751098
"hidden": true,
10761099
"pages": [
10771100
"xdks/python/overview",
@@ -1464,7 +1487,7 @@
14641487
]
14651488
},
14661489
{
1467-
"tab": "TypeScript SDK",
1490+
"tab": "TypeScript XDK",
14681491
"hidden": true,
14691492
"pages": [
14701493
"xdks/typescript/overview",

overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ Earn free [xAI API](https://docs.x.ai) credits when you purchase X API credits
8383
<Card title="Developer Forum" icon="comments" href="https://devcommunity.x.com">
8484
Get help from the community and X team.
8585
</Card>
86-
<Card title="Changelog" icon="clock-rotate-left" href="/changelog">
87-
Stay updated on API changes and new features.
86+
<Card title="AI & LLM Resources" icon="sparkles" href="/tools/ai-docs">
87+
llms.txt, skill.md, MCP servers, and resources for AI-powered development.
8888
</Card>
8989
</CardGroup>
9090

tools-and-libraries.mdx

Lines changed: 22 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
---
22
title: Tools & Libraries
3-
icon: toolbox
4-
description: Official SDKs, community libraries, and developer tools for the X API
5-
keywords: ["tools", "libraries", "SDK", "XDK", "client libraries", "Postman", "xurl", "developer tools", "API tools", "code libraries", "Python SDK", "TypeScript SDK"]
3+
sidebarTitle: Overview
4+
description: Official SDKs, developer tools, AI integrations, and community libraries for the X API
5+
keywords: ["tools", "libraries", "SDK", "XDK", "client libraries", "Postman", "xurl", "playground", "XMCP", "developer tools", "API tools", "code libraries", "Python SDK", "TypeScript SDK", "AI tools", "MCP"]
66
---
77

88
import { Button } from '/snippets/button.mdx';
99

10-
Speed up your development with official SDKs, community libraries, and developer tools.
10+
Speed up your development with official SDKs, developer tools, and community libraries.
1111

1212
---
1313

1414
## Official SDKs
1515

16-
X provides official SDKs for TypeScript and Python with full X API v2 support.
17-
1816
<CardGroup cols={2}>
1917
<Card title="Python SDK" icon="python" href="/xdks/python/overview">
2018
Async support, type hints, and automatic token refresh. Perfect for data analysis and automation.
@@ -24,57 +22,36 @@ X provides official SDKs for TypeScript and Python with full X API v2 support.
2422
</Card>
2523
</CardGroup>
2624

27-
### Why use the official SDKs?
28-
29-
| Benefit | Description |
30-
|:--------|:------------|
31-
| **Always up-to-date** | Maintained by X, updated with new endpoints |
32-
| **Type safety** | Full type definitions for all objects and methods |
33-
| **Built-in auth** | OAuth 2.0 and OAuth 1.0a support |
34-
| **Automatic pagination** | Iterate through results without manual token handling |
35-
3625
### Quick start
3726

3827
<Tabs>
3928
<Tab title="Python">
40-
#### Installation
41-
4229
```bash
4330
pip install xdk
4431
```
4532

46-
#### Basic usage
47-
4833
```python
4934
from xdk import Client
5035

5136
client = Client(bearer_token="YOUR_BEARER_TOKEN")
5237

53-
# Search for posts (returns an iterator)
5438
for page in client.posts.search_recent(query="api", max_results=10):
5539
if page.data and len(page.data) > 0:
56-
first_post = page.data[0]
57-
print(first_post.text)
40+
print(page.data[0].text)
5841
break
5942
```
6043

6144
<Button href="/xdks/python/overview">Full Python guide</Button>
6245
</Tab>
6346
<Tab title="TypeScript">
64-
#### Installation
65-
6647
```bash
6748
npm install @xdevplatform/xdk
6849
```
6950

70-
#### Basic usage
71-
7251
```typescript
7352
import { Client } from '@xdevplatform/xdk';
7453

7554
const client = new Client({ bearerToken: 'YOUR_BEARER_TOKEN' });
76-
77-
// Look up a user
7855
const userResponse = await client.users.getByUsername('XDevelopers');
7956
console.log(userResponse.data?.username);
8057
```
@@ -83,140 +60,29 @@ console.log(userResponse.data?.username);
8360
</Tab>
8461
</Tabs>
8562

86-
### Authentication
87-
88-
Both SDKs support multiple authentication methods:
89-
90-
<Tabs>
91-
<Tab title="Bearer Token (App-only)">
92-
Simplest option for reading public data.
93-
94-
**Python:**
95-
```python
96-
from xdk import Client
97-
98-
client = Client(bearer_token="YOUR_BEARER_TOKEN")
99-
```
100-
101-
**TypeScript:**
102-
```typescript
103-
import { Client } from '@xdevplatform/xdk';
104-
105-
const client = new Client({ bearerToken: 'YOUR_BEARER_TOKEN' });
106-
```
107-
</Tab>
108-
<Tab title="OAuth 2.0 (User Context)">
109-
For actions on behalf of users (posting, following, etc.).
110-
111-
**Python:**
112-
```python
113-
from xdk import Client
114-
from xdk.oauth2_auth import OAuth2PKCEAuth
115-
116-
auth = OAuth2PKCEAuth(
117-
client_id="YOUR_CLIENT_ID",
118-
redirect_uri="YOUR_CALLBACK_URL",
119-
scope="tweet.read users.read offline.access"
120-
)
121-
122-
# Get authorization URL
123-
auth_url = auth.get_authorization_url()
124-
125-
# After user authorizes, exchange code for tokens
126-
tokens = auth.fetch_token(authorization_response=callback_url)
127-
client = Client(bearer_token=tokens["access_token"])
128-
```
129-
130-
**TypeScript:**
131-
```typescript
132-
import { Client, OAuth2, generateCodeVerifier, generateCodeChallenge } from '@xdevplatform/xdk';
133-
134-
const oauth2 = new OAuth2({
135-
clientId: 'YOUR_CLIENT_ID',
136-
clientSecret: 'YOUR_CLIENT_SECRET',
137-
redirectUri: 'https://your-app.com/callback',
138-
scope: ['tweet.read', 'users.read', 'offline.access'],
139-
});
140-
141-
const codeVerifier = generateCodeVerifier();
142-
const codeChallenge = await generateCodeChallenge(codeVerifier);
143-
oauth2.setPkceParameters(codeVerifier, codeChallenge);
144-
const authUrl = await oauth2.getAuthorizationUrl('state');
145-
146-
// After authorization, exchange code
147-
const tokens = await oauth2.exchangeCode(authCode, codeVerifier);
148-
const client = new Client({ accessToken: tokens.access_token });
149-
```
150-
</Tab>
151-
<Tab title="OAuth 1.0a (User Context)">
152-
For legacy applications or specific use cases.
153-
154-
**Python:**
155-
```python
156-
from xdk import Client
157-
from xdk.oauth1_auth import OAuth1
158-
159-
oauth1 = OAuth1(
160-
api_key="YOUR_API_KEY",
161-
api_secret="YOUR_API_SECRET",
162-
access_token="YOUR_ACCESS_TOKEN",
163-
access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
164-
)
165-
166-
client = Client(auth=oauth1)
167-
```
168-
169-
**TypeScript:**
170-
```typescript
171-
import { Client, OAuth1 } from '@xdevplatform/xdk';
172-
173-
const oauth1 = new OAuth1({
174-
apiKey: 'YOUR_API_KEY',
175-
apiSecret: 'YOUR_API_SECRET',
176-
accessToken: 'YOUR_ACCESS_TOKEN',
177-
accessTokenSecret: 'YOUR_ACCESS_TOKEN_SECRET'
178-
});
179-
180-
const client = new Client({ oauth1: oauth1 });
181-
```
182-
</Tab>
183-
</Tabs>
184-
185-
### Available methods
186-
187-
The SDKs provide methods for all X API v2 endpoints:
63+
---
18864

189-
| Category | Python | TypeScript |
190-
|:---------|:-------|:-----------|
191-
| **Posts** | `client.posts.search_recent()` | `client.posts.search()` |
192-
| **Users** | `client.users.get_me()` | `client.users.getMe()` |
193-
| **Spaces** | `client.spaces.get()` | `client.spaces.findSpaceById()` |
194-
| **Lists** | `client.lists.get()` | `client.lists.getList()` |
195-
| **DMs** | `client.direct_messages.get()` | `client.directMessages.lookup()` |
65+
## Developer tools
19666

19767
<CardGroup cols={2}>
198-
<Card title="Python SDK Docs" icon="book" href="/xdks/python/overview">
199-
Complete Python documentation.
68+
<Card title="Postman Collection" icon="server" href="https://www.postman.com/xapidevelopers/x-api-public-workspace/collection/34902927-2efc5689-99c6-4ab6-8091-996f35c2fd80">
69+
Interactive API testing for all v2 endpoints.
20070
</Card>
201-
<Card title="TypeScript SDK Docs" icon="book" href="/xdks/typescript/overview">
202-
Complete TypeScript documentation.
71+
<Card title="xurl" icon="terminal" href="/tools/xurl">
72+
curl-like CLI for the X API with built-in OAuth authentication. No manual token management.
20373
</Card>
204-
<Card title="Python GitHub" icon="github" href="https://github.com/xdevplatform/xdk-py">
205-
Source code and issues.
74+
<Card title="API Playground" icon="flask" href="https://github.com/xdevplatform/playground">
75+
Local mock server for testing X API v2 endpoints without using real credits.
20676
</Card>
207-
<Card title="TypeScript GitHub" icon="github" href="https://github.com/xdevplatform/twitter-api-typescript-sdk">
208-
Source code and issues.
77+
<Card title="AI & LLM Resources" icon="sparkles" href="/tools/ai-docs">
78+
XMCP, llms.txt, skill.md, docs MCP server, and resources for AI-powered development.
20979
</Card>
21080
</CardGroup>
21181

212-
---
213-
214-
## Official tools
82+
### Other tools
21583

21684
| Tool | Description |
21785
|:-----|:------------|
218-
| [Postman Collection](https://www.postman.com/xapidevelopers/x-api-public-workspace/collection/34902927-2efc5689-99c6-4ab6-8091-996f35c2fd80) | Interactive API testing for all v2 endpoints |
219-
| [xurl](https://github.com/xdevplatform/xurl) | Command line tool for the X APIs that handles authentication for you |
22086
| [OpenAPI Spec](https://api.x.com/2/openapi.json) | Machine-readable API specification |
22187
| [twitter-text](https://github.com/twitter/twitter-text) | Parse and validate post text, count characters |
22288
| [Embed Generator](https://publish.x.com/#) | Build embeddable posts, timelines, or buttons for your site |
@@ -225,7 +91,7 @@ The SDKs provide methods for all X API v2 endpoints:
22591

22692
## Community libraries
22793

228-
These community-maintained libraries support X API v2. Check each library's documentation for current API coverage.
94+
Community-maintained libraries with X API v2 support. Check each library's documentation for current coverage.
22995

23096
<Tabs>
23197
<Tab title="Python">
@@ -289,35 +155,14 @@ Community libraries are not maintained by X. Check their repositories for suppor
289155

290156
---
291157

292-
## X Ads API libraries
293-
294-
For tools and libraries specific to the X Ads API, see the [Ads API tools and libraries](/x-ads-api/tools-and-libraries) page.
295-
296-
---
297-
298158
## Code samples
299159

300-
Find examples on GitHub:
301-
302-
- [X API v2 Sample Code](https://github.com/xdevplatform/Twitter-API-v2-sample-code) - Examples in Python, JavaScript, Ruby, and more
303-
- [X Developer GitHub](https://github.com/xdevplatform) - Official repos and tools
304-
- [Code Samples Repo](https://github.com/xdevplatform/samples) - Examples using the official XDKs
305-
- [Glitch Examples](https://glitch.com/@twitter) - Interactive, remixable apps
306-
- [Replit Examples](https://replit.com/@twitter) - Browser-based coding
307-
308-
---
309-
310-
## Building a library?
311-
312-
If you have built an X API library, share it with the community:
313-
314-
1. Post in the [Libraries and SDKs forum](https://devcommunity.x.com/c/libraries-and-sdks/63)
315-
2. We may add it to this page!
160+
- [X API v2 Sample Code](https://github.com/xdevplatform/Twitter-API-v2-sample-code) — Examples in Python, JavaScript, Ruby, and more
161+
- [Code Samples Repo](https://github.com/xdevplatform/samples) — Examples using the official XDKs
162+
- [X Developer GitHub](https://github.com/xdevplatform) — Official repos and tools
316163

317164
---
318165

319-
## Getting help
166+
## X Ads API libraries
320167

321-
<Card title="Developer Forum" icon="comments" href="https://devcommunity.x.com">
322-
Get help from the community.
323-
</Card>
168+
For tools and libraries specific to the X Ads API, see the [Ads API tools and libraries](/x-ads-api/tools-and-libraries) page.

0 commit comments

Comments
 (0)