twitterapi-io-client
v1.0.4
Published
A TypeScript client library for the TwitterAPI.io API
Maintainers
Readme
TwitterAPI.io TypeScript Client
A TypeScript client library for the TwitterAPI.io API.
Installation
npm install twitterapi-io-clientUsage
Setup
import { TwitterAPIIOClient } from 'twitterapi-io-client';
const client = new TwitterAPIIOClient({
apiKey: 'your-api-key'
});
const accountInfo = await client.getUserProfileAbout("jorvixsky")Supported Endpoints
✅ User Endpoint
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get User Profile About | GET /twitter/user_about | ✅ Supported | client.users.getUserProfileAbout(userName) |
| Batch Get User Info By UserIds | GET /twitter/user/batch_info_by_ids | ✅ Supported | client.users.batchGetUserInfoByUserIds(userIds) |
| Get User Info | GET /twitter/user/info | ✅ Supported | client.users.getUserInfo(userName) |
| Get User Last Tweets | GET /twitter/user/latest_tweets | ✅ Supported | client.users.getUserLatestTweets(userId?, userName?, cursor?, pageSize?, includeReplies?) |
| Get User Followers | GET /twitter/user/followers | ✅ Supported | client.users.getUserFollowers(userName, cursor?, pageSize?) |
| Get User Followings | GET /twitter/user/followings | ✅ Supported | client.users.getUserFollowings(userName, cursor?, pageSize?) |
| Get User Mentions | GET /twitter/user/mentions | ✅ Supported | client.users.getUserMentions(username, sinceTime, untilTime, cursor?) |
| Check Follow Relationship | GET /twitter/user/check_follow_relationship | ✅ Supported | client.users.checkFollowRelationship(sourceUserName, targetUserName) |
| Search user by keyword | GET /twitter/user/search | ✅ Supported | client.users.searchUserByKeyword(query, cursor?) |
| Get User Verified Followers | GET /twitter/user/verifiedFollowers | ✅ Supported | client.users.getUserVerifiedFollowers(userId, cursor?) |
✅ List Endpoint
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get List Followers | GET /twitter/list/followers | ✅ Supported | client.list.getListFollowers(listId, cursor?) |
| Get List Members | GET /twitter/list/members | ✅ Supported | client.list.getListMembers(listId, cursor?) |
✅ My Endpoint
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get My Account Info | GET /oapi/my/info | ✅ Supported | client.myEndpoint.getMyAccountInfo() |
✅ Communities Endpoint
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get Community Info By Id | GET /twitter/community/info | ✅ Supported | client.communities.getCommunityInfo(communityId) |
| Get Community Members | GET /twitter/community/members | ✅ Supported | client.communities.getCommunityMembers(communityId, cursor?) |
| Get Community Moderators | GET /twitter/community/moderators | ✅ Supported | client.communities.getCommunityModerators(communityId, cursor?) |
| Get Community Tweets | GET /twitter/community/tweets | ✅ Supported | client.communities.getCommunityTweets(communityId, cursor?) |
| Search Tweets From All Community | GET /twitter/community/search | ✅ Supported | client.communities.searchCommunityTweets(query, queryType?, cursor?) |
✅ Trend Endpoint
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get Trends | GET /twitter/trends | ✅ Supported | client.trends.getTrends(woeid) |
✅ Spaces Endpoint
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get Space Detail | GET /twitter/space/detail | ✅ Supported | client.spaces.getSpaceDetail(spaceId) |
✅ Tweet Endpoint
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get Tweets by IDs | GET /twitter/tweet/by_ids | ✅ Supported | client.tweets.getTweetsByIds(tweetIds) |
| Get Tweet Replies | GET /twitter/tweet/replies | ✅ Supported | client.tweets.getTweetReplies(tweetId, cursor?) |
| Get Tweet Quotations | GET /twitter/tweet/quotations | ✅ Supported | client.tweets.getTweetQuotations(tweetId, cursor?) |
| Get Tweet Retweeters | GET /twitter/tweet/retweeters | ✅ Supported | client.tweets.getTweetRetweeters(tweetId, cursor?) |
| Get Tweet Thread Context | GET /twitter/tweet/thread_context | ✅ Supported | client.tweets.getTweetThreadContext(tweetId) |
| Get Article | GET /twitter/article | ✅ Supported | client.tweets.getArticle(articleId) |
| Advanced Search | GET /twitter/search | ✅ Supported | client.tweets.searchTweets(query, queryType?, cursor?) |
✅ Stream Endpoint
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Add User to Monitor | POST /oapi/x_user_stream/add_user_to_monitor_tweet | ✅ Supported | client.stream.addUserToMonitor(xUserName) |
| Remove User from Monitor | POST /oapi/x_user_stream/remove_user_from_monitor_tweet | ✅ Supported | client.stream.removeUserFromMonitor(xUserName) |
Not Supported Endpoints
The following endpoint categories are not yet implemented:
❌ Post & Action Endpoint V2
POST /oapi/login- Log inPOST /oapi/upload/media- Upload mediaPOST /oapi/tweet/create- Create tweet v2GET /oapi/dm/history- Get History Messages By UserIDPOST /oapi/dm/send- Send DM V2POST /oapi/tweet/retweet- Retweet TweetPOST /oapi/tweet/delete- Delete TweetPOST /oapi/user/follow- Follow UserPOST /oapi/user/unfollow- Unfollow UserPOST /oapi/tweet/like- Like TweetPOST /oapi/tweet/unlike- Unlike TweetPOST /oapi/community/create- Create Community V2POST /oapi/community/delete- Delete Community V2POST /oapi/community/join- Join Community v2POST /oapi/community/leave- Leave Community V2
❌ Webhook/Websocket Filter Rule
POST /oapi/webhook/filter/add- Add Webhook/Websocket Tweet Filter RuleGET /oapi/webhook/filter/all- Get ALL test Webhook/Websocket Tweet Filter RulesPOST /oapi/webhook/filter/update- Update Webhook/Websocket Tweet Filter RuleDELETE /oapi/webhook/filter/delete- Delete Webhook/Websocket Tweet Filter Rule
❌ Deprecated Endpoints
The following endpoints are marked as deprecated in the API documentation and are not implemented:
Login Endpoint (deprecated)
POST /oapi/login/step1- Login Step 1: by email or usernamePOST /oapi/login/step2- Login Step 2: by 2fa code
Tweet Action Endpoint (deprecated)
POST /oapi/tweet/upload_image- Upload ImagePOST /oapi/tweet/post- Post/reply/quote a tweetPOST /oapi/tweet/like- Like a tweetPOST /oapi/tweet/retweet- Retweet a tweet
Implementation Status Summary
- Fully Supported: 29 endpoints (10 User endpoints + 2 List endpoints + 1 My endpoint + 5 Communities endpoints + 1 Trend endpoint + 1 Spaces endpoint + 7 Tweet endpoints + 2 Stream endpoints)
- Not Implemented: ~14+ endpoints across multiple categories
Contributing
Contributions are welcome! If you'd like to add support for additional endpoints, please refer to the existing implementation patterns in the src/resources/ directory.
API Documentation
For detailed API documentation, visit: https://docs.twitterapi.io
Support the project
If you need to create your twitterapi-io account and you want to support this client to help me mantain it and make your implementation easier for you, you can do so by using this affiliate link.
