A TypeScript client library for the TwitterAPI.io API
npm install twitterapi-io-clientA TypeScript client library for the TwitterAPI.io API.
``bash`
npm install twitterapi-io-client
`typescript
import { TwitterAPIIOClient } from 'twitterapi-io-client';
const client = new TwitterAPIIOClient({
apiKey: 'your-api-key'
});
const accountInfo = await client.getUserProfileAbout("jorvixsky")
`
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get User Profile About | GET /twitter/user_about | ✅ Supported | client.users.getUserProfileAbout(userName) |GET /twitter/user/batch_info_by_ids
| Batch Get User Info By UserIds | | ✅ Supported | client.users.batchGetUserInfoByUserIds(userIds) |GET /twitter/user/info
| Get User Info | | ✅ Supported | client.users.getUserInfo(userName) |GET /twitter/user/latest_tweets
| Get User Last Tweets | | ✅ Supported | client.users.getUserLatestTweets(userId?, userName?, cursor?, pageSize?, includeReplies?) |GET /twitter/user/followers
| Get User Followers | | ✅ Supported | client.users.getUserFollowers(userName, cursor?, pageSize?) |GET /twitter/user/followings
| Get User Followings | | ✅ Supported | client.users.getUserFollowings(userName, cursor?, pageSize?) |GET /twitter/user/mentions
| Get User Mentions | | ✅ Supported | client.users.getUserMentions(username, sinceTime, untilTime, cursor?) |GET /twitter/user/check_follow_relationship
| Check Follow Relationship | | ✅ Supported | client.users.checkFollowRelationship(sourceUserName, targetUserName) |GET /twitter/user/search
| Search user by keyword | | ✅ Supported | client.users.searchUserByKeyword(query, cursor?) |GET /twitter/user/verifiedFollowers
| Get User Verified Followers | | ✅ Supported | client.users.getUserVerifiedFollowers(userId, cursor?) |
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get List Followers | GET /twitter/list/followers | ✅ Supported | client.list.getListFollowers(listId, cursor?) |GET /twitter/list/members
| Get List Members | | ✅ Supported | client.list.getListMembers(listId, cursor?) |
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get My Account Info | GET /oapi/my/info | ✅ Supported | client.myEndpoint.getMyAccountInfo() |
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get Community Info By Id | GET /twitter/community/info | ✅ Supported | client.communities.getCommunityInfo(communityId) |GET /twitter/community/members
| Get Community Members | | ✅ Supported | client.communities.getCommunityMembers(communityId, cursor?) |GET /twitter/community/moderators
| Get Community Moderators | | ✅ Supported | client.communities.getCommunityModerators(communityId, cursor?) |GET /twitter/community/tweets
| Get Community Tweets | | ✅ Supported | client.communities.getCommunityTweets(communityId, cursor?) |GET /twitter/community/search
| Search Tweets From All Community | | ✅ Supported | client.communities.searchCommunityTweets(query, queryType?, cursor?) |
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get Trends | GET /twitter/trends | ✅ Supported | client.trends.getTrends(woeid) |
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get Space Detail | GET /twitter/space/detail | ✅ Supported | client.spaces.getSpaceDetail(spaceId) |
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Get Tweets by IDs | GET /twitter/tweet/by_ids | ✅ Supported | client.tweets.getTweetsByIds(tweetIds) |GET /twitter/tweet/replies
| Get Tweet Replies | | ✅ Supported | client.tweets.getTweetReplies(tweetId, cursor?) |GET /twitter/tweet/quotations
| Get Tweet Quotations | | ✅ Supported | client.tweets.getTweetQuotations(tweetId, cursor?) |GET /twitter/tweet/retweeters
| Get Tweet Retweeters | | ✅ Supported | client.tweets.getTweetRetweeters(tweetId, cursor?) |GET /twitter/tweet/thread_context
| Get Tweet Thread Context | | ✅ Supported | client.tweets.getTweetThreadContext(tweetId) |GET /twitter/article
| Get Article | | ✅ Supported | client.tweets.getArticle(articleId) |GET /twitter/search
| Advanced Search | | ✅ Supported | client.tweets.searchTweets(query, queryType?, cursor?) |
| Endpoint | Method | Status | Notes |
|----------|--------|--------|-------|
| Add User to Monitor | POST /oapi/x_user_stream/add_user_to_monitor_tweet | ✅ Supported | client.stream.addUserToMonitor(xUserName) |POST /oapi/x_user_stream/remove_user_from_monitor_tweet
| Remove User from Monitor | | ✅ Supported | client.stream.removeUserFromMonitor(xUserName) |
The following endpoint categories are not yet implemented:
- 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
- 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
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
- 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
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.
For detailed API documentation, visit: https://docs.twitterapi.io
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.