🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

twitter-cookie

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitter-cookie

A simple utility to get twitter cookies (as JSON array). Can be used for initialize twitter client (agent-twitter-client or @the-convocation/twitter-scraper)

1.0.3
latest
npm
Version published
Weekly downloads
9
50%
Maintainers
0
Weekly downloads
 
Created
Source

A simple utility to help you extract your Twitter (X) cookies in JSON format, making it easy to use with libraries like agent-twitter-client or @the-convocation/twitter-scraper.

Why Use This?

Many Twitter API alternatives require your browser cookies to authenticate requests. This tool simplifies the process of extracting those cookies in the correct format.

Installation

npm install -g twitter-cookie

Usage

twitter-cookie <username> <password>

Or simply without installation:

npx twitter-cookie <username> <password>

Your cookies will be printed to the console as JSON array. You can then use it to initialize the Scraper class from agent-twitter-client or @the-convocation/twitter-scraper.

Example

import { Scraper } from "agent-twitter-client";

const scraper = new Scraper();

await scraper.setCookies(cookies);

// use scraper to do something...

Security Note

Keep your cookie file secure and never share it. These cookies provide full access to your Twitter account.

License

MIT License

Keywords

Twitter

FAQs

Package last updated on 04 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts