Git Product home page Git Product logo

figma-plugins-stats's Introduction

Deprecated


Figma Plugins Stats npm Version build

A CLI to get live and historical stats for your Figma plugins

N.B. Figma Plugin Stats is not official software by Figma. It relies on Figma’s internal APIs, which may break or become unavailable at any time.

Quick start

Requires Node.js.

To get the plugin stats for a particular plugin publisher, enter npx --yes -- figma-plugins-stats followed by a profile handle:

$ npx --yes -- figma-plugins-stats yuanqing

  period  7d
  from    2022-06-25 14:04:59 UTC+8
  to      2022-07-03 00:14:46 UTC+8

  no  name                         publisher      runs                    installs              likes            views
  1   Clean Document               Yuan Qing Lim  ▁▁▁▁█ 39,082  ↑39,082   ▆▇█▅▁ 75,926  ↑397    ▄▂█▆▁ 949   ↑10  ▄▅█▇▁ 49,777  ↑467
  2   Insert Big Image             Yuan Qing Lim  ▁▁▁▁█ 36,468  ↑36,468   ▇██▃▁ 44,379  ↑456    ▆▆█▁▁ 471   ↑7   ▄▅█▇▁ 40,870  ↑667
  3   Draw Connector               Yuan Qing Lim  ▁▁▁▁█ 19,737  ↑19,737   ▄▆█▄▁ 21,266  ↑302    █▄▁█▁ 353   ↑5   ▄▅█▆▁ 33,135  ↑606
  4   Select Layers                Yuan Qing Lim  ▁▁▁▁█ 12,066  ↑12,066   ▅▇█▄▁ 16,563  ↑188    ▆▁█▁▁ 281   ↑5   ▃▄█▄▁ 17,691  ↑335
  5   Sort Layers                  Yuan Qing Lim  ▁▁▁▁█ 8,536   ↑8,536    ▅▅█▂▁ 11,375  ↑81     ▁▁▁▁▁ 169        ▃▃█▇▁ 11,694  ↑172
  6   Organize Layers              Yuan Qing Lim  ▁▁▁▁█ 8,458   ↑8,458    ███▆▁ 12,958  ↑73     ▁██▁▁ 217   ↑2   ▃▅█▆▁ 15,518  ↑127
  7   Flatten Selection to Bitmap  Yuan Qing Lim  ▁▁▁▁█ 8,236   ↑8,236    ▇█▇▂▁ 10,484  ↑68     ▁█▁▁▁ 142   ↑1   ▅▅█▇▁ 13,725  ↑180
  8   Component Utilities          Yuan Qing Lim  ▁▁▁▁█ 5,661   ↑5,661    ▄█▃▂▁ 7,458   ↑23     █▁▁▁▁ 213   ↑1   ▄▅█▄▁ 17,855  ↑148
  9   Upscale Image                Yuan Qing Lim  ▁▁▁▁█ 2,898   ↑2,898    █▅▆▃▁ 3,428   ↑46     ▁▁▁▁▁ 63         █▅▇▆▁ 4,745   ↑81
  10  Language Tester              Yuan Qing Lim  ▁▁▁▁█ 2,764   ↑2,764    █▄▄▃▁ 4,202   ↑27     ▁▁▁▁▁ 72         ▃▆█▅▁ 5,402   ↑71
  11  Text Utilities               Yuan Qing Lim  ▁▁▁▁█ 1,476   ↑1,476    ██▄▁▁ 1,969   ↑10     █▁▁▁▁ 78    ↑1   ▆▄█▄▁ 6,038   ↑53
  12  Set Layer Size               Yuan Qing Lim  ▁▁▁▁█ 1,290   ↑1,290    ██▄▄▁ 2,121   ↑12     ▁▁▁▁▁ 46         ▅██▄▁ 3,641   ↑36
  13  Format Currency              Yuan Qing Lim  ▁▁▁▁█ 1,227   ↑1,227    ▅█▁▄▁ 2,208   ↑10     ▁▁▁▁▁ 32         ▄▅█▅▂ 4,214   ↑58
  14  Distribute Layers            Yuan Qing Lim  ▁▁▁▁█ 767     ↑767      ▄▅█▁▁ 1,975   ↑10     █▁▁▁▁ 32    ↑1   ▆██▇▂ 2,506   ↑22
  15  Move Layers                  Yuan Qing Lim  ▁▁▁▁█ 676     ↑676      █▆▃▁▁ 1,959   ↑6      ▁▁▁▁▁ 33         ▄█▆▄▃ 2,676   ↑18
  16  Draw Mask Under Selection    Yuan Qing Lim  ▁▁▁▁█ 608     ↑608      █▄▄▁▁ 1,129   ↑4      ▁▁▁▁▁ 24         ▄▄█▄▁ 1,801   ↑11
  17  Draw Slice Over Selection    Yuan Qing Lim  ▁▁▁▁█ 418     ↑418      ▁█▄▁▁ 1,246   ↑2      ▁▁▁▁▁ 20         ▁▁█▂▁ 1,388   ↑15

                                   totals         ▁▁▁▁█ 150,368 ↑150,368  ▆██▄▁ 220,646 ↑1,715  █▅█▄▁ 3,195 ↑33  ▄▅█▆▁ 232,676 ↑3,067

In the above example, for the plugin Clean Document, we see that:

  • 75,926 is the current install count.
  • 397 is the increase in install count over the 7-day period.
  • The sparkline (▆▇█▅▁) shows the trend in the increase in install count over the period.

By default, the historical time period is 7 days.

  • Set this using the --time flag. For example: --time 7d, --time 2w.
  • N.B. Historical data goes back to 1 April 2020 at the most.

By default, plugins are sorted in descending order of the increase in run count.

  • Set this using the --sort flag. For example: --sort publisher, --sort name, --sort installs, --sort installs-delta, --sort likes, --sort likes-delta, --sort runs, --sort runs-delta, --sort views, --sort views-delta.

Omit the profile handle to get the stats for all Figma plugins:

$ npx --yes -- figma-plugins-stats | less -r

CLI

$ npx --yes -- figma-plugins-stats --help

  A CLI to get live and historical stats for your Figma plugins.

  Usage:
    $ figma-plugins-stats <handle> [options]

  Arguments:
    <handle>  A Figma profile handle.

  Options:
    -h, --help     Print this message.
    -l, --limit    Limit the number of plugins returned.
    -s, --sort     Set the sort order. One of 'name', 'publisher', 'installs',
                   'installs-delta', 'likes', 'likes-delta', 'runs',
                   'runs-delta', 'views' or 'views-delta'. Defaults to
                   'runs-delta'.
    -t, --time     Set the period of historical data to show. Defaults to
                   '7d'.
    -v, --version  Print the version.

  Examples:
    $ figma-plugins-stats | less -r
    $ figma-plugins-stats yuanqing
    $ figma-plugins-stats --limit 10
    $ figma-plugins-stats --sort name
    $ figma-plugins-stats --sort publisher
    $ figma-plugins-stats --sort installs
    $ figma-plugins-stats --sort installs-delta
    $ figma-plugins-stats --sort likes
    $ figma-plugins-stats --sort likes-delta
    $ figma-plugins-stats --sort runs
    $ figma-plugins-stats --sort runs-delta
    $ figma-plugins-stats --sort views
    $ figma-plugins-stats --sort views-delta
    $ figma-plugins-stats --time 7d
    $ figma-plugins-stats --time 2w

API

import { fetchLivePluginsDataAsync } from 'figma-plugins-stats'

const plugins = await fetchLivePluginsDataAsync()

Fetches the latest meta data and stats of all public Figma plugins.

Returns a Promise for an array of objects that each have the following keys:

  • id
  • name
  • description
  • lastUpdateDate
  • publisherHandle
  • publisherId
  • publisherName
  • installCount
  • likeCount
  • runCount
  • viewCount

Installation

$ npm install --global figma-plugins-stats

Shields.io badges

Figma Plugins Stats also provides a JSON API for displaying stats as Shields.io badges on a GitHub README page.

Plugin stats

Replace <ID> with your Figma plugin ID

runs

![runs](https://img.shields.io/endpoint?url=https://yuanqing.github.io/figma-plugins-stats/plugin/<ID>/runs.json)

installs

![installs](https://img.shields.io/endpoint?url=https://yuanqing.github.io/figma-plugins-stats/plugin/<ID>/installs.json)

likes

![likes](https://img.shields.io/endpoint?url=https://yuanqing.github.io/figma-plugins-stats/plugin/<ID>/likes.json)

views

![views](https://img.shields.io/endpoint?url=https://yuanqing.github.io/figma-plugins-stats/plugin/<ID>/views.json)

Publisher stats

Replace <PUBLISHER> with your Figma profile handle

total runs

![total runs](https://img.shields.io/endpoint?url=https://yuanqing.github.io/figma-plugins-stats/publisher/<PUBLISHER>/runs.json)

total installs

![total installs](https://img.shields.io/endpoint?url=https://yuanqing.github.io/figma-plugins-stats/publisher/<PUBLISHER>/installs.json)

total likes

![total likes](https://img.shields.io/endpoint?url=https://yuanqing.github.io/figma-plugins-stats/publisher/<PUBLISHER>/likes.json)

total views

![total views](https://img.shields.io/endpoint?url=https://yuanqing.github.io/figma-plugins-stats/publisher/<PUBLISHER>/views.json)

Implementation details

A snapshot of the stats for all Figma plugins is taken everyday at approximately 6 AM UTC+0, via a GitHub action. (The first snapshot was taken on 1 April 2020.) Each snapshot is stored as a JSON file and served on GitHub pages. Historical data surfaced in the CLI is backed by these snapshots.

License

MIT

figma-plugins-stats's People

Contributors

yuanqing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

figma-plugins-stats's Issues

Support org based published plugins

First of all, thank you for this CLI! Is an awesome idea and gives some visibility about our stats as plugin creators!

When you publish a plugin using an organization plan, the plugins rest api provides an additional field author_org, which provides the organization id and name that actually holds the plugin ownership and that is what is actually is shown to the users in the plugin page.

i.e:
https://www.figma.com/community/plugin/822809274991177560/Frametastic

Currently I'm not able to fetch this plugin data trough your CLI asnpx figma-plugins-stats cabify doesn't holds any plugin, and npx figma-plugins-stats Ismael Gonzalez looks like an invalid username.

Is there any chance you can support the org plan plugins?

Stats are not being returned

It happens both using the CLI:

figma-plugins-stats basiclines                                                                                !6278
error invalid json response body at https://www.figma.com/api/profile_handle/basiclines reason: Unexpected token < in JSON at position 0

And the API through NodeJS require functions:

(node:2755) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://www.figma.com/api/profile_handle/basiclines reason: Unexpected token < in JSON at position 0
12
    at /home/runner/work/figma-plugin-stats-notify/figma-plugin-stats-notify/node_modules/node-fetch/lib/index.js:272:32
13
    at process._tickCallback (internal/process/next_tick.js:68:7)
14
(node:2755) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
15
(node:2755) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Doesn't return the numbers.

The script worked flawlessly, but recently I am getting:
User xyz has no public plugins

For your user it returns just one plugin, but you do have more:
image

Scrape broken due to change in Figma’s internal API

$ node scripts/scrape.js
(node:2695) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'plugins' of undefined
    at fetchRawData (/home/runner/work/figma-plugins-stats/figma-plugins-stats/src/fetch/fetch-figma-plugins-stats.js:14:38)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async fetchFigmaPluginsStats (/home/runner/work/figma-plugins-stats/figma-plugins-stats/src/fetch/fetch-figma-plugins-stats.js:4:16)
    at async main (/home/runner/work/figma-plugins-stats/figma-plugins-stats/scripts/scrape.js:11:19)
(node:2695) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2695) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 1.28s.

https://github.com/yuanqing/figma-plugins-stats/runs/1011126255?check_suite_focus=true

Number of Installs vs Number of Users in new a recent Figma Release

Now, with the recent changes to the plugins, they don't need to actually be installed, and Figma seems to count the "number of the user (I guess?)":
image

Eg. Figma plugin's community page shows 568 "users", while the actuall number of "installs" in returned by your script shows 280:
image

Are you considering updating the script, so it will show also the new "users" count?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.