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 🙏

© 2026 – Pkg Stats / Ryan Hefner

envato-api-request

v1.0.9

Published

Easily interact with the Envato Market API using a personal token.

Readme

envato-api-request

This projects helps you to make HTTP requests to the Envato API.

Installation

npm i envato-api-request

Usage

First you must require the package into your module. Note that the package exports a function which is used for setting your personal token and user agent.

Be sure to replace the two variables.

  • TOKEN is the secret token you retrieved from https://build.envato.com/my-apps.
  • USERNAME is a description of your script only visible to the Envato API team.
// Import package
const EnvatoAPI = require('envato-api-request')

// Inisialisasi personal token
const envato = EnvatoAPI({
  username: 'YOUR_USERNAME',
  token: 'YOUR_TOKEN_CODE'
})

// getTotalItems
envato.getTotalItems()
.then(items => console.log(items))
.catch(err => console.log(err))

Methods

Each method is detailed at https://build.envato.com/api/. All parameter names are the same, and should be passed inside an object.

Envato Market Catalog

Look up a public collection: getCatalogCollection(params)

Returns details of, and items contained within, a public collection

envato.getCatalogCollection({ id: 5087427 , page: 1 })
.then(result => console.log(result))
.catch(err => console.log(err))

Look up a single item: getLookSingleItem(id)

Returns all details of a particular item on Envato Market

// Envato Item ID
let itemId = 2833226

envato.getCatalogItem(itemId)
.then(result => console.log(result))
.catch(err => console.log(err))

Look up a wordpress theme/plugin version: getCatalogItemVersion(params)

Returns the latest available version of a theme/plugin. This is the recommended endpoint for Wordpress theme/plugin authors building an auto-upgrade system into their item that needs to check if a new version is available. This public endpoint doesn't require a token.

envato.getCatalogItemVersion({ id: 22857100 })
.then(result => console.log(result))
.catch(err => console.log(err))

Search for items: getSearchItem(params)

envato.getSearchItem({ term: 'dog', site: 'graphicriver.net' })
.then(result => console.log(result))
.catch(err => console.log(err))

Search for comments: getSearchComment(params)

envato.getSearchComment({ item_id: 233775 })
.then(result => console.log(result))
.catch(err => console.log(err))

Search more like this: getSearchMoreLikeThis(params)

envato.getSearchMoreLikeThis({ item_id: 233775 })
.then(result => console.log(result))
.catch(err => console.log(err))

Popular items by site: getPopular()

Returns the popular files for a particular site. Requires a site parameter, e.g. popular:themeforest

envato.getPopular({ site: 'graphicriver' })
.then(result => console.log(result))
.catch(err => console.log(err))

Categories by site getCategories(params)

Lists the categories of a particular site. Requires a site parameter, e.g. themeforest

envato.getCategories({ site: 'graphicriver' })
.then(result => console.log(result))
.catch(err => console.log(err))

Prices for a particular item: getItemPrices(params)

Return available licenses and prices for the given item ID

envato.getItemPrices({ item_id: 233775 })
.then(result => console.log(result))
.catch(err => console.log(err))

New items by site and category: getNewFiles(params)

New files, recently uploaded to a particular site. Requires site and category parameters, e.g. new-files:themeforest,site-templates or new-files:graphicriver,graphics

envato.getNewFiles({ site: 'graphicriver', category: 'graphics' })
.then(result => console.log(result))
.catch(err => console.log(err))

Find featured items getFeatures(params)

Shows the current site features.

envato.getFeatures({ site: 'graphicriver' })
.then(result => console.log(result))
.catch(err => console.log(err))

Random new items: getRandomNewFiles(params)

Shows a random list of newly uploaded files from a particular site (i.e. like the homepage). Requires a site parameter, e.g. random-new-files:themeforest

envato.getFeatures({ site: 'graphicriver' })
.then(result => console.log(result))
.catch(err => console.log(err))

User Details

User account details getUser(params)

Shows username, country, number of sales, number of followers, location and image for a user. Requires a username, e.g. collis

envato.getUser({ username: 'collis' })
.then(result => console.log(result))
.catch(err => console.log(err))

List a user's badges: getUserBadges(params)

Shows a list of badges for the given user

envato.getUserBadges({ username: 'collis' })
.then(result => console.log(result))
.catch(err => console.log(err))

A user's items by site: getUserItemsBySite(params)

Show the number of items an author has for sale on each site. Requires a username, e.g. collis

envato.getUserItemsBySite({ username: 'collis' })
.then(result => console.log(result))
.catch(err => console.log(err))

New Items by user: getNewFilesFromUser(params)

Shows up to 1000 newest files uploaded by a user to a particular site. Requires username and site parameters, e.g. new-files-from-user:collis,themeforest

envato.getNewFilesFromUser({ username: 'collis', site: 'graphicriver' })
.then(result => console.log(result))
.catch(err => console.log(err))

Envato Market Stats

Total Envato Market users: getTotalUsers()

Shows the total number of subscribed users to Envato Market

envato.getTotalUsers()
.then(result => console.log(result))
.catch(err => console.log(err))

Total Envato Market items: getTotalItems()

Shows the total number of items available on Envato Market

envato.getTotalItems()
.then(result => console.log(result))
.catch(err => console.log(err))

Number of files in category: getNumberOfFiles(params)

Shows the number of files in the major categories of a particular site. Requires a site parameter, e.g. number-of-files:themeforest

envato.getNumberOfFiles({ site: 'themeforest' })
.then(result => console.log(result))
.catch(err => console.log(err))

Return

Each method will return a Promise which will resolve with the parsed JSON object or reject with an error. The output is not modified, so the output is the same as on build.envato.com.

envato.getUser({ username: 'collis' })
.then(result => console.log(result))
.catch(err => console.log(err))

// or

envato.getUser({ username: 'collis' })
.then(function(result) {
  console.log(result)
})
.catch(function(err) {
  console.log(err)
})

Errors

The error.message property will contain the following under these circumstances:

  • Bad Request when invalid parameters are sent or required parameters are missing.
  • Unauthorized when the personal token is invalid.
  • Access Denied when you've reached your rate limit or are banned.
  • Not Found when no matches or results were found by the endpoint.
  • Internal Server Error when the API is experiencing problems.
  • Request Error: <message> when there's an error executing the HTTP request.
    • Timeout errors
    • Connection errors
    • SSL errors
  • Error code <000>: <message> when another HTTP code is received than those above.