Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

@taka2829/itunes-track-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@taka2829/itunes-track-api

itunes APIを叩く為のパッケージ

latest
npmnpm
Version
1.0.4
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ITunesAPI Class

ITunesAPI クラスは、iTunes API を使用して音楽トラックを検索するための TypeScript クラスです。

使用方法

インポート

import {ITunesAPI} from "@taka2829/itunes-track-api";

トラックの検索

// 検索オプションを設定
const searchOption: APIOption = {
  term: "TM NETWORK", // 検索キーワード
  limit: 5, // 検索結果の最大数
};
const results: Track[] = await ITunesAPI.searchTracks(searchOption);

サンプル

[
  {
  "wrapperType": "track",
  "kind": "song",
  "artistId": 265737160,
  "collectionId": 1701373394,
  "trackId": 1701373807,
  "artistName": "TM NETWORK",
  "collectionName": "Whatever Comes - Single",
  "trackName": "Whatever Comes",
  "collectionCensoredName": "Whatever Comes - Single",
  "trackCensoredName": "Whatever Comes",
  "artistViewUrl": "https://music.apple.com/jp/artist/tm-network/265737160?uo=4",
  "collectionViewUrl": "https://music.apple.com/jp/album/whatever-comes/1701373394?i=1701373807&uo=4",
  "trackViewUrl": "https://music.apple.com/jp/album/whatever-comes/1701373394?i=1701373807&uo=4",
  "previewUrl": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview116/v4/c6/92/5e/c6925e03-0b32-78cd-2832-de6a1f89f2c7/mzaf_11094352269459584552.plus.aac.p.m4a",
  "artworkUrl30": "https://is4-ssl.mzstatic.com/image/thumb/Music126/v4/13/63/18/136318a5-bab5-0d7f-4fd6-a41206d7dbf1/4547366638233.jpg/30x30bb.jpg",
  "artworkUrl60": "https://is4-ssl.mzstatic.com/image/thumb/Music126/v4/13/63/18/136318a5-bab5-0d7f-4fd6-a41206d7dbf1/4547366638233.jpg/60x60bb.jpg",
  "artworkUrl100": "https://is4-ssl.mzstatic.com/image/thumb/Music126/v4/13/63/18/136318a5-bab5-0d7f-4fd6-a41206d7dbf1/4547366638233.jpg/100x100bb.jpg",
  "collectionPrice": 255,
  "trackPrice": 255,
  "releaseDate": "2023-08-23T12:00:00Z",
  "collectionExplicitness": "notExplicit",
  "trackExplicitness": "notExplicit",
  "discCount": 1,
  "discNumber": 1,
  "trackCount": 1,
  "trackNumber": 1,
  "trackTimeMillis": 292693,
  "country": "JPN",
  "currency": "JPY",
  "primaryGenreName": "J-Pop",
  "isStreamable": true
  },
  ...
]

オプション

searchTracks メソッドに渡すことができる検索オプションの詳細については、APIOption インターフェースを参照してください。

FAQs

Package last updated on 06 Sep 2023

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