npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

snapchat

v2.0.2

Published

Nodejs client for the unofficial Snapchat API

Readme

Snapchat

Nodejs client for the unofficial Snapchat API

This project is a node.js port of the excellent Objective-C SnapchatKit library by Tanner Bennett (ThePantsThief).

It provides an easy-to-use client interface to Snapchat's unofficial API, allowing Javascript developers to script Snapchat!

Status

Most API methods are working and up-to-date with the current version of Snapchat, though there are some non-core methods which are untested. For example usage, please refer to the tests.

Install

npm install snapchat

Usage

The main entrypoint is the Snapchat class. See the auto-generated documentation for a detailed API reference.

Snapchat defaults to using required signin credentials stored in environment variables:

  • SNAPCHAT_USERNAME The Snapchat username to sign in with.
  • SNAPCHAT_PASSWORD The password to the Snapchat account to sign in with.
  • SNAPCHAT_GMAIL_EMAIL A valid GMail address.
  • SNAPCHAT_GMAIL_PASSWORD The password for the GMail address.
var Snapchat = require('snapchat')

var client = new Snapchat()
// note the signIn will default to credentials stored in environment variables
client.signIn(function (err, session) {
  if (!err) {
    console.log('signed in', client.username)
  }
})

Or with explicit credentials:

var Snapchat = require('snapchat')

var client = new Snapchat()
client.signIn('myusername', 'mypassword', '[email protected]', 'mygmailpassword', function (err, session) {
  if (!err) {
    console.log('signed in', client.username)
  }
})

NOTE Only Snapchat accounts created via an Android client should be used with this library. iOS accounts are handled separately by Snapchat, and your account will most likely be flagged / disabled as suspicious if you try to use a Snapchat account created on iOS.

NOTE Any valid gmail address and password may be used; it does not have to be the one the Snapchat user was created with.

Contribute

js-standard-style

See CONTRIBUTING.

Debugging

You can enable debug logs by setting the DEBUG environment variable:

DEBUG=snapchat; # debug core snapchat

OR

DEBUG=snapchat,snapchat:*; # debug all snapchat submodules

Third party resources

  • https://github.com/ThePantsThief/SnapchatKit
  • https://gibsonsec.org/snapchat/fulldisclosure/
  • https://github.com/mgp25/SC-API/wiki/API-v2-Research/
  • https://github.com/mgp25/SC-API/
  • https://github.com/liamcottle/AttestationServlet

Credits

  • Tanner Bennett (ThePantsThief), the auther of the Objective-C library SnapchatKit, which this version is heavily based on.
  • Everyone who built and maintains the PHP implementation.
  • See nykac's old node version.

Author

Todo

  • MORE TESTS
  • rate limiting (currently test suite is failing with 401 errors because of rate limiting issues)
  • check logged status in Request.start response handler
  • handle request encoding properly for blobs and non-text requests
  • sendEvents inconsistent between Array[event] and event

License

MIT. Copyright (c) Travis Fischer.

Legal

I believe it's 100% legal to use a "private" REST API and that there are no laws explicitly prohibiting the use of "private" REST APIs. However, this does not mean that the makers of these private APIs can't try to sue you under something overly-broad, such as the CFAA. I don't think Snapchat will, personally; in my experience they've only gone after developers for copyright disputes.

Disclaimer: The name "Snapchat" is a copyright of Snapchat™, Inc. This project is in no way affiliated with, sponsored, or endorsed by Snapchat™, Inc. I, the project owner and creator, am not responsible for any legalities that may arise in the use of this project. Use at your own risk.