Skip to content

A TypeScript client library for the TwitterAPI.io API

License

Notifications You must be signed in to change notification settings

jorvixsky/twitterapi-io-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TwitterAPI.io TypeScript Client

A TypeScript client library for the TwitterAPI.io API.

Installation

npm install twitterapi-io-client

Usage

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 in
  • POST /oapi/upload/media - Upload media
  • POST /oapi/tweet/create - Create tweet v2
  • GET /oapi/dm/history - Get History Messages By UserID
  • POST /oapi/dm/send - Send DM V2
  • POST /oapi/tweet/retweet - Retweet Tweet
  • POST /oapi/tweet/delete - Delete Tweet
  • POST /oapi/user/follow - Follow User
  • POST /oapi/user/unfollow - Unfollow User
  • POST /oapi/tweet/like - Like Tweet
  • POST /oapi/tweet/unlike - Unlike Tweet
  • POST /oapi/community/create - Create Community V2
  • POST /oapi/community/delete - Delete Community V2
  • POST /oapi/community/join - Join Community v2
  • POST /oapi/community/leave - Leave Community V2

❌ Webhook/Websocket Filter Rule

  • POST /oapi/webhook/filter/add - Add Webhook/Websocket Tweet Filter Rule
  • GET /oapi/webhook/filter/all - Get ALL test Webhook/Websocket Tweet Filter Rules
  • POST /oapi/webhook/filter/update - Update Webhook/Websocket Tweet Filter Rule
  • DELETE /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 username
    • POST /oapi/login/step2 - Login Step 2: by 2fa code
  • Tweet Action Endpoint (deprecated)

    • POST /oapi/tweet/upload_image - Upload Image
    • POST /oapi/tweet/post - Post/reply/quote a tweet
    • POST /oapi/tweet/like - Like a tweet
    • POST /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.

About

A TypeScript client library for the TwitterAPI.io API

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published