# twitter-gengar-typescript

> Implementation of Twitter internal API in TypeScript

Latest version **0.0.32** (published 2024-11-13) · custom license or AGPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install twitter-gengar-typescript
pnpm add twitter-gengar-typescript
yarn add twitter-gengar-typescript
bun add twitter-gengar-typescript
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.0.32 |
| Published | 2024-11-13 |
| First published | 2023-12-17 |
| Weekly downloads | 0 |
| License | custom license or AGPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 271.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 223 |
| Author | gengar__ |
| Maintainers | gengar__ |
| Keywords | twitter, api, typescript, scraper |

## Links

- npm: https://www.npmjs.com/package/twitter-gengar-typescript
- Repository: https://github.com/fa0311/twitter-openapi-typescript
- Homepage: https://github.com/fa0311/twitter-openapi-typescript#readme
- Issues: https://github.com/fa0311/twitter-openapi-typescript/issues
- npm.io page: https://npm.io/package/twitter-gengar-typescript

## Dependencies (1)

- [twitter-gengar-generated](https://npm.io/package/twitter-gengar-generated.md) ^0.0.25

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.32 (latest) — 2024-11-13
- 0.0.31 — 2024-09-23
- 0.0.30 — 2024-08-15
- 0.0.29 — 2024-08-05
- 0.0.28 — 2024-08-04
- 0.0.27 — 2024-08-04
- 0.0.26 — 2023-12-17
- 0.0.25 — 2023-12-17

## README

# twitter-openapi-typescript

## Setup

```sh
npm i twitter-openapi-typescript
```

## Usage

```typescript
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

```typescript
// 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.

```typescript
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:

- [Custom License](./LICENSE)
- [GNU Affero General Public License v3.0](./LICENSE.AGPL)

---
_Source: https://npm.io/package/twitter-gengar-typescript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
