Socket
Book a DemoInstallSign in
Socket

imslp-api

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imslp-api

Access composer and work data directly from the IMSLP API. JSON is stored in an array of objects for convenience.

latest
Source
npmnpm
Version
2.0.3
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

npm version GitHub release Github all releases Maintenance GitHub issues Node.js CI

IMSLP API

Get data from the IMSLP API without having to deal with their horrible JSON format yourself! Get easy access to a massive list of composers and works, along with all the linked metadata and links related to them.

Information

The International Music Score Library Project, also known as the Petrucci Music Library after publisher Ottaviano Petrucci, is a subscription-based project for the creation of a virtual library of public-domain music scores.
As of May 21, 2020 at 9:46 AM Eastern Standard Time, ISMLP stands at an index of:
159,144 works · 18,825 composers · 539 performers
515,993 scores · 10,474,167+ pages · 61,121 recordings

Tutorial

GET Composers

To get the JSON list of composers, you need to run the composers(<start>, <amount>) function.
Note that amount should stay a relatively reasonable number due to JavaScript's throttling.
Example:

// Import API
const api = require("imslp-api");

// GET Composers
// Here are two examples
api.composers(6, 1);
// This will return index 6 on the list
api.composers(0, 2);
// This will return 2 composers starting from index 0

Let's take a look at what api.composers(1, 5) returns:

[
  {
    id: "Category:A",
    name: "A",
    link: "https://imslp.org/wiki/Category:A",
  },
  {
    id: "Category:A Far Cry",
    name: "A Far Cry",
    link: "https://imslp.org/wiki/Category:A_Far_Cry",
  },
  {
    id: "Category:.q, Wulfi",
    name: ".q, Wulfi",
    link: "https://imslp.org/wiki/Category:.q,_Wulfi",
  },
  {
    id: "Category:(van Luiken) Bakker, Jeroen",
    name: "(van Luiken) Bakker, Jeroen",
    link: "https://imslp.org/wiki/Category:(van_Luiken)_Bakker,_Jeroen",
  },
  {
    id: "Category:A Fary Cry",
    name: "A Fary Cry",
    link: "https://imslp.org/wiki/Category:A_Fary_Cry",
  },
];

GET Works

To get the JSON list of works, you need to run the works(<start>, <amount>) function.
Note that amount should stay a relatively reasonable number due to JavaScript's throttling.
Example:

// Import API
const api = require("imslp-api");

// GET Works
// Here are two examples
api.works(4, 1);
// This will return index 4 on the list
api.works(8, 3);
// This will return 2 works starting from index 8

Let's take a look at what api.works(8, 3) returns:

[
  {
    id: "'A calamita (Von Calged, Kosta)",
    composer: "Von Calged, Kosta",
    title: "'A calamita",
    links: {
      work: "https://imslp.org/wiki/'A_calamita_(Von_Calged,_Kosta)",
      composer: "https://imslp.org/wiki/Category:Von_Calged,_Kosta",
    },
  },
  {
    id: "'A calamita (Von Calged, Kosta)",
    composer: "Von Calged, Kosta",
    title: "'A calamita",
    links: {
      work: "https://imslp.org/wiki/'A_calamita_(Von_Calged,_Kosta)",
      composer: "https://imslp.org/wiki/Category:Von_Calged,_Kosta",
    },
  },
  {
    id: "'A calamita (Von Calged, Kosta)",
    composer: "Von Calged, Kosta",
    title: "'A calamita",
    links: {
      work: "https://imslp.org/wiki/'A_calamita_(Von_Calged,_Kosta)",
      composer: "https://imslp.org/wiki/Category:Von_Calged,_Kosta",
    },
  },
];

API Structure

The following tables contain the tags for the API and Package JSON.
API Object ID is the ID corresponding to certain information served directly from ISMLP. You'll probably never have to use it, unless you're trying to tweak this package.
Package Object ID is the ID corresponding to the information that the package will return to you based on the function you're using. You can check what kind of data they return in the return codeembeds up in the GET Works section.
Use / Value is the description of what the data is used for in the API.

Composers

API Object IDPackage Object IDUse / Value
data.ididCategory name of the composer.
Used in the IMSLP link.
data.type-Type of the data. Can be either composer
or work. (1 and 2 respectively)
data.parent-Parent of the composer category.
Is empty.
data.intvals-Extra data, only used in works.
Is empty.
data.permlinklinkLink to the composer category.

Works

API Object IDPackage Object IDUse / Value
data.ididCategory name of the work.
Used in the IMSLP link.
data.type-Type of the data. Can be either composer
or work. (1 and 2 respectively)
data.parentcomposerParent of the composer category.
Is empty.
data.intvalslinks.<work/composer>Subcategory containing work name and
composer name in the API.
Contains links in the package.
data.permlink-Link to the composer category.

Keywords

music

FAQs

Package last updated on 19 Aug 2020

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.