Socket
Socket
Sign inDemoInstall

first-listen-api

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

first-listen-api

Query data from NPR First Listen


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

First Listen API Build Status

Query data from NPR First Listen

$ npm install --save first-listen-api

usage

With CommonJS

var firstListenApi = require('first-listen-api')

You can access the full NPR First Listen archive, much like viewing http://www.npr.org/series/98679384/first-listen

firstListenApi.getArchive(function (err, archive) { })

archive will be an array of objects. Some represent a "review" and others represent a "first-listen" album. Here are some examples:

{
  type: 'first-listen',
  artist: '',
  album: '',
  streaming: true, // if the album is _currently_ available for streaming
  url: 'http...'
}
{
  type: 'review',
  artist: '',
  album: '',
  url: 'http...'
}

If you'd like to see past the first page of results, you can specify a start. It defaults to 0

firstListenApi.getArchive({ start: 15 }, function (err, res) { })

To get further than this, you'll need an API key. We'll assume you have one and call it apiKey.

If you have an NPR First Listen URL and you want the album artwork, I've got just what you're looking for.

firstListenApi.getAlbumArtUrl({
  url: firstListenUrl,
  apiKey: apiKey
}, function (err, albumArtUrl) { })

If you have an NPR First Listen URL that is currently streaming and you want the individual songs in that album, you can find them here:

firstListenApi.getFirstListen({
  url: firstListenUrl,
  apiKey: apiKey
}, function (err, songs) { })

songs will be an array of objects. Those objects will look something like this:

{
  track: 1,
  title: '',
  artist: '',
  album: '',
  url: 'http...'
}

That's all for now.

FAQs

Package last updated on 25 Mar 2016

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc