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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nyakimov/senscritique-api

v1.1.5

Published

An unofficial API for Senscritique

Downloads

5

Readme

@nyakimov/senscritique-api

Import

Import the library using require

const sc = require('@nyakimov/senscritique-api')

search

Call search with some keywords to display 16 results

const sc = require('@nyakimov/senscritique-api')

var page = 1 //Optional (default = 1)
sc.search(`The witcher`, page).then(res => {
    console.log(res)
})

Result {
    items: [{
        title: 'The Witcher',
        type: 'Série',
        creators: [ 'Lauren Schmidt Hissrich' ],
        year: ' 2019',
        genres: [ 'Fantasy', 'Aventure' ],
        rating: '6.5',
        url: 'https://www.senscritique.com/serie/...'
    },
    ...
  ],
  total: 722571,
  base_url: 'https://www.senscritique.com/search',
  query: 'https://www.senscritique.com/search?q=The witcher&p=1',
  params: { q: 'The witcher', p: 1 }
}

get

Call get with the url of a movie/book/tvshow to get detailed informations

const sc = require('@nyakimov/senscritique-api')

sc.get(`https://www.senscritique.com/jeuvideo/The_Witcher/85891`).then(res => {
    console.log(res)
})

Result {
  title: 'The Witcher',
  cover: 'https://media.senscritique.com/media/...',
  rating: '7.4',
  ...
}

collection

Call collection with the name of a member and filter options (optional)

const sc = require('@nyakimov/senscritique-api')

sc.collection(`radegast`, {type : Type.FILM}).then(res => {
    console.log(res)
})

Result {
  items: [
    {
      title: 'Melancholia',
      rating: '7.0',
      member: 'wish',
      date: '26/05/2011',
      creators: [ 'Lars von Trier' ]
    },
    ...
  ],
  base_url: 'https://www.senscritique.com/radegast/collection',
  query: 'https://www.senscritique.com/radegast/collection/all/all/all/page-1',
  params: {
    member: 'radegast',
    type: 'all',
    action: 'all',
    filter: 'all',
    page: 1
  }
}

all

Call all with the name of a member to get all their rating/wishes/recommendations (equivalent of doing collection for all pages available)

const sc = require('@nyakimov/senscritique-api')

//Export all records of radegast
sc.all(`radegast`).then(res => {
    console.log(res)
})

//Export entire list of wishes of radegast
sc.all(`radegast`, Action.WISH).then(res => {
    console.log(res)
})

//Export entire list of games of radegast
sc.all(`radegast`, Action.ALL, Type.GAME).then(res => {
    console.log(res)
})

/!\ Can return an empty list if the user has defined his profile as private

member

Call member with the name of a member to get global information about a user of Senscritique

const sc = require('@nyakimov/senscritique-api')

//Export all records of radegast
sc.member(`radegast`).then(res => {
    console.log(res)
})

Result {
    member : `Radegast`,
    avatar : `https://media.senscritique.com/media/...`
    ...
}

Object returned by get function

Get Result {
    title: String,
    cover: String,
    rating: String,
    rating_details: { 
        rating: Number,
        recommend: Number, 
        wish: Number, 
        current: Number 
    },
    resume: String,
    type: String,
    creators: [...String],
    genres: [...String],
    date: String,
    versus: [{
        author: String, //Person with a positive opinion
        rating: String,
        title: String,
        description: String,
        url: String
    },{
        author: String, //Person with a negative opinion
        rating: String,
        title: String,
        description: String,
        url: String
    }
}

Object returned by member function

Member Result {
    member: String,
    avatar: String,
    description: String,
    followers: Number,
    following: Number, 
    rates: Number, 
    links: [...{
        label : String,
        url   : String
    }],
    stats: [...{
        category: String,
        value: Number,
        url: String
    }],
    top10: [...{
        title: String,
        top: [...{
            podium: Number,
            title: String,
            year: Number
        }]
    }],
    url: String
}

Options available for collection function

Defaut option:

var default_options = {
    action  : Action.ALL, 
    type    : Type.ALL, 
    filter  : Filter.ALL,
    page    : 1,
}
sc.search(`something`, default_options).then(result => ...)

action (also works in all function)

  • Action.ALL (default)
  • Action.WISH : member's wishes
  • Action.RECOMMEND: member's favorites
  • Action.CURRENT : member is currently watching/reading/playing
  • Action.RATING : member was rated
  • Action.DONE : what is not in current

type

  • Type.ALL (default)
  • Type.FILM
  • Type.SERIE
  • Type.GAME
  • Type.BOOK
  • Type.COMICS
  • Type.ALBUM
  • Type.TRACK

filter

  • Filter.ALL (default)
  • Filter.DATE : sort by release date
  • Filter.USER : sort by member's rating
  • Filter.RATING : sort by global rating
  • Filter.POPULARITY
  • Filter.ALPHABETIC