All URIs are relative to https://x.com/i/api
| Method | HTTP request | Description |
|---|---|---|
| getUsersByRestIds | GET /graphql/{pathQueryId}/UsersByRestIds |
UsersResponse getUsersByRestIds(pathQueryId, variables, features)
get users by rest ids
import {
Configuration,
UsersApi,
} from 'twitter-openapi-typescript-generated';
import type { GetUsersByRestIdsRequest } from 'twitter-openapi-typescript-generated';
async function example() {
console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
const config = new Configuration({
// To configure API key authorization: Accept
apiKey: "YOUR API KEY",
// To configure API key authorization: ClientLanguage
apiKey: "YOUR API KEY",
// To configure API key authorization: Priority
apiKey: "YOUR API KEY",
// To configure API key authorization: Referer
apiKey: "YOUR API KEY",
// To configure API key authorization: SecFetchDest
apiKey: "YOUR API KEY",
// To configure API key authorization: SecChUaPlatform
apiKey: "YOUR API KEY",
// To configure API key authorization: SecFetchMode
apiKey: "YOUR API KEY",
// To configure API key authorization: CsrfToken
apiKey: "YOUR API KEY",
// To configure API key authorization: ClientUuid
apiKey: "YOUR API KEY",
// Configure HTTP bearer authorization: BearerAuth
accessToken: "YOUR BEARER TOKEN",
// To configure API key authorization: GuestToken
apiKey: "YOUR API KEY",
// To configure API key authorization: SecChUa
apiKey: "YOUR API KEY",
// To configure API key authorization: CookieGt0
apiKey: "YOUR API KEY",
// To configure API key authorization: ClientTransactionId
apiKey: "YOUR API KEY",
// To configure API key authorization: ActiveUser
apiKey: "YOUR API KEY",
// To configure API key authorization: CookieCt0
apiKey: "YOUR API KEY",
// To configure API key authorization: UserAgent
apiKey: "YOUR API KEY",
// To configure API key authorization: AcceptLanguage
apiKey: "YOUR API KEY",
// To configure API key authorization: SecFetchSite
apiKey: "YOUR API KEY",
// To configure API key authorization: AuthType
apiKey: "YOUR API KEY",
// To configure API key authorization: CookieAuthToken
apiKey: "YOUR API KEY",
// To configure API key authorization: SecChUaMobile
apiKey: "YOUR API KEY",
// To configure API key authorization: AcceptEncoding
apiKey: "YOUR API KEY",
});
const api = new UsersApi(config);
const body = {
// string
pathQueryId: _8egOzcbgeLIhP0TbTStGw,
// string
variables: {"userIds": ["44196397"]},
// string
features: {"payments_enabled": false, "profile_label_improvements_pcf_label_in_post_enabled": true, "responsive_web_profile_redirect_enabled": false, "rweb_tipjar_consumption_enabled": true, "verified_phone_label_enabled": false, "responsive_web_graphql_skip_user_profile_image_extensions_enabled": false, "responsive_web_graphql_timeline_navigation_enabled": true},
} satisfies GetUsersByRestIdsRequest;
try {
const data = await api.getUsersByRestIds(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);| Name | Type | Description | Notes |
|---|---|---|---|
| pathQueryId | string |
[Defaults to '_8egOzcbgeLIhP0TbTStGw'] |
|
| variables | string |
[Defaults to '{\"userIds\": [\"44196397\"]}'] |
|
| features | string |
[Defaults to '{\"payments_enabled\": false, \"profile_label_improvements_pcf_label_in_post_enabled\": true, \"responsive_web_profile_redirect_enabled\": false, \"rweb_tipjar_consumption_enabled\": true, \"verified_phone_label_enabled\": false, \"responsive_web_graphql_skip_user_profile_image_extensions_enabled\": false, \"responsive_web_graphql_timeline_navigation_enabled\": true}'] |
Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful operation | * x-connection-hash - * x-rate-limit-limit - * x-rate-limit-remaining - * x-rate-limit-reset - * x-response-time - * x-tfe-preserve-body - * x-transaction-id - * x-twitter-response-tags - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]