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

itunes-store-api

v2.1.0

Published

Query Apple store catalogs using the iTunes Search API.

Downloads

10

Readme

itunes-store-api

💿 Query Apple store catalogs using the iTunes Search API.

build npm size coverage license

  • 🗜️ Small: Tree-shakeable and around 1.4 kB on modern platforms
  • 🔎 URLs: Supports looking items up from their store URLs
  • 🧪 Reliable: Fully tested with 100% code coverage
  • 📦 Typed: Written in TypeScript and includes definitions out-of-the-box
  • 💨 Zero dependencies

Introduction

itunes-store-api is a typed iTunes Search API client which adds support for looking items up from their store URLs.

Installation

Skypack

import { search, lookup } from "https://cdn.skypack.dev/itunes-store-api"

Yarn

yarn add itunes-store-api

npm

npm install itunes-store-api

Usage

search

Import search.

import { search } from "itunes-store-api"

Invoke it asynchronously and access results in return.

const { results } = await search("M83")

// results: [Result, Result, Result…]

lookup

Import lookup.

import { lookup } from "itunes-store-api"

Invoke it asynchronously using a lookup type ("id", "isbn", "upc", "url", "amgAlbumId", "amgArtistId" or "amgVideoId") and access a result in return.

const { results } = await lookup("id", 1007596731)

// results: [Result]
"url"

A variety of store catalog URLs are supported when using the "url" lookup type.

| Entity | Example | | ----------- | --------------------------------------------------------------------------- | | Software | https://apps.apple.com/us/app/letterboxd/id1054271011 | | Audiobook | https://books.apple.com/gb/audiobook/the-diary-of-a-young-girl/id1440416363 | | Book | https://books.apple.com/us/book/the-communist-manifesto/id395544966 | | Author | https://books.apple.com/us/author/albert-camus/id57528162 | | Song | https://music.apple.com/us/album/kim-jessie/1007596648?i=1007596731 | | Album | https://music.apple.com/us/album/wolfgang-amadeus-phoenix/1450828963 | | Music Video | https://music.apple.com/us/music-video/daydreaming/1441607175 | | Artist | https://music.apple.com/us/artist/a-g-cook/744253464 | | Podcast | https://podcasts.apple.com/us/podcast/panic-podcast/id1495115716 |

Options

Both search and lookup support a trailing options argument.

country

A two-letter country code where the queried store catalog will be from. Defaults to "us".

await lookup("id", 1491051628, { country: "fr" })

limit

Limit the number of results. Defaults to 50.

await search("C418", { limit: 10 })

sort

Whether to sort results by popularity ("popular") or recentness ("recent"). Defaults to "popular".

await search("Twitter", { sort: "popular" })

media

The media type to search for—see Table 2-1. Defaults to "all".

await search("Lost in Translation", { media: "movie" })

entity

The type of results returned, relative to the specified media type—see Table 2-1.

const album = await lookup("id", 1007596648)
const songs = await lookup("id", 1007596648, { entity: "song" })

// album: { results: [ResultAlbum] }
// songs: { results: [ResultMusicTrack, ResultMusicTrack, ResultMusicTrack…] }

attribute

Which attribute to search for, relative to the specified media type—see Table 2-2.

await search("Greta Gerwig", { entity: "movieArtist", attribute: "actorTerm" })

explicit

Whether to include explicit content. Defaults to true.

await search("My Beautiful Dark Twisted Fantasy", { explicit: true })