https://github.com/ultrasev/xreader
https://github.com/ultrasev/xreader
api docker jinaai twitter-api vercel
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ultrasev/xreader
- Owner: ultrasev
- License: mit
- Created: 2024-11-02T04:29:36.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-02T08:51:57.000Z (over 1 year ago)
- Last Synced: 2025-03-13T18:47:47.581Z (over 1 year ago)
- Topics: api, docker, jinaai, twitter-api, vercel
- Language: Python
- Homepage: https://xreader.vercel.app
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Twitter 文本提取 API
一个简单的 API 项目,用于提取 Twitter/X 平台帖子的文本内容,可部署在 Vercel 或者 VPS 上。
## 有哪些功能?
- 通过简单的 GET 请求轻松访问推文内容
- 无需 Twitter API 凭证即可清洗提取文本
- 同时支持 twitter.com 和 x.com 的 URL
- 轻量级设计,响应速度快
## 实现原理
本 API 封闭了以下接口:
- Twitter 的 CDN API:`https://cdn.syndication.twimg.com/tweet-result?id=[tweet_id]&token=[token]`
- [React-Tweet 项目](https://react-tweet.vercel.app/) - Twitter CDN API 的封装
- [Jina AI API](https://r.jina.ai/) - 支持从 Twitter 等平台获取内容
- 更多详情请参考[这条推文](https://x.com/slippertopia/status/1852523921330893082)
### 为什么需要 Jina AI API?
对于长推文,CDN API 返回的数据是截断的,这种情况下,本 API 会调用 Jina AI API 进行再次提取。
## 使用方法
### API 接口
- **URL**: [`https://xreader.vercel.app/x`](https://xreader.vercel.app/x)
- **查询参数**: `url` - Twitter/X 帖子的 URL
- **请求方式**: GET
### 示例
```bash
curl 'https://xreader.vercel.app/x?url=https://x.com/EllenDeGeneres/status/440322224407314432'
```
### 返回格式
```json
{
"text": "If only Bradley's arm was longer. Best photo ever. #oscars http://t.co/C9U5NOtGap",
"status": "success"
}
```
### 错误处理
| 状态码 | 说明 |
| ------ | ------------ |
| 200 | 成功 |
| 400 | URL 格式无效 |
| 500 | 服务器错误 |
## Vercel 部署
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fultrasev%2Fxreader)
## 联系方式
如有问题或需要支持,请通过 Twitter 联系:[@slippertopia](https://x.com/slippertopia)