0.0.33 • Published 3 days ago

twitter-openapi-typescript v0.0.33

Weekly downloads
-
License
custom license or...
Repository
github
Last release
3 days ago

twitter-openapi-typescript

Setup

npm i twitter-openapi-typescript

Usage

import { TwitterOpenApi } from 'twitter-openapi-typescript';

const api = new TwitterOpenApi();
const client = await api.getGuestClient();
const response = await client.getUserApi().getUserByScreenName({ screenName: 'elonmusk' });
console.log(response.data.legacy.screenName);
console.log(`followCount: ${response.data.legacy.friendsCount} followersCount: ${response.data.legacy.followersCount}`);

Login

// ct0 and authToken will also work but it is recommended to set all cookies.
const client = await api.getClientFromCookies({
  ct0: '<csrf_token>',
  auth_token: '<auth_token>',
});

List of APIs

You should read the Test case. aaaaa

https://github.com/fa0311/twitter-openapi-typescript/tree/master/twitter-openapi-typescript/test/api

Customize in detail

Most values exist as static variables. There is no need to change them.

import { TwitterOpenApi } from 'twitter-openapi-typescript';
TwitterOpenApi.url = 'twitter-openapi placeholder json url';
TwitterOpenApi.twitter = 'twitter first access url';
TwitterOpenApi.userAgent = 'user agent';
TwitterOpenApi.bearer = 'bearer token';
TwitterOpenApi.browser_headers = 'browser headers';
TwitterOpenApi.api_key = 'api key';

License

This project is dual licensed. You can choose one of the following licenses:

0.0.33

3 days ago

0.0.32

1 month ago

0.0.31

2 months ago

0.0.30

3 months ago

0.0.29

3 months ago

0.0.28

3 months ago

0.0.26

3 months ago

0.0.27

3 months ago

0.0.25

6 months ago

0.0.20

6 months ago

0.0.21

6 months ago

0.0.22

6 months ago

0.0.23

6 months ago

0.0.24

6 months ago

0.0.17

7 months ago

0.0.18

6 months ago

0.0.19

6 months ago

0.0.16

8 months ago

0.0.15

8 months ago

0.0.14

9 months ago

0.0.13

9 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago