### Install Musicfetch SDK Source: https://musicfetch.io/docs/sdk Use npm to add the package to your project. ```bash npm install musicfetch ``` -------------------------------- ### GET /url Source: https://musicfetch.io/docs/url Resolves a music-service link into normalized metadata and matching links on other platforms. ```APIDOC ## GET /url ### Description Resolves a music-service link into normalized metadata and matching links on other platforms. Use it for song-link matching, album-link matching, artist-link matching, and cross-platform music metadata enrichment. ### Method GET ### Endpoint https://api.musicfetch.io/url ### Parameters #### Query Parameters - **url** (string) - Required - The music service URL to resolve. - **services** (string) - Optional - A comma-separated list of services to return matching links for (e.g., appleMusic,youtube). ### Request Example curl "https://api.musicfetch.io/url?url=https://open.spotify.com/track/6habFhsOp2NvshLv26DqMb&services=appleMusic,youtube" \ -H "x-token: YOUR_TOKEN" ``` -------------------------------- ### Authenticate and Query ISRC Source: https://musicfetch.io/docs Example of using cURL to perform an ISRC lookup with an authorization header. ```bash curl https://api.musicfetch.io/isrc?isrc=USUG11901472&services=appleMusic \ -H 'x-token: YOUR_TOKEN' ``` -------------------------------- ### UPC API response structure Source: https://musicfetch.io/docs/upc Example of a successful 200 OK response containing the normalized MusicfetchAlbum object. ```json { "result": { "type": "album", "name": "Pink Moon", "image": { 3 items }, "releaseDate": "1972-02-25T00:00:00.000Z", "label": "UMC (Universal Music Catalogue)", "copyright": "©℗ 1972 Island Records, a division of Universal Music Operations Limited", "totalTracks": 11, "upc": "00602438276004", "genres": [ 2 items ], "services": { 4 items }, "artists": [ 1 item ], "tracks": [ 11 items ] } } ``` -------------------------------- ### GET https://api.musicfetch.io/url Source: https://musicfetch.io/docs/url Retrieves normalized metadata and matching links for a given music service URL. ```APIDOC ## GET https://api.musicfetch.io/url ### Description Retrieves normalized metadata and matching links for a given music service URL across requested services. ### Method GET ### Endpoint https://api.musicfetch.io/url ### Parameters #### Query Parameters - **url** (string) - Required - A music link from a supported platform (e.g., spotify, appleMusic, youtube). - **services** (array of enums) - Required - A comma-separated list of music services to fetch matching data from. - **country** (enum) - Optional - The country to fetch local links for (e.g., US, GB, FR). - **withTracks** (boolean) - Optional - Include track information. - **withLyrics** (boolean) - Optional - Include lyrics information. - **withDistributor** (boolean) - Optional - Include distributor information. - **withPerformance** (boolean) - Optional - Include performance information. - **withCredits** (boolean) - Optional - Include credits information. - **withErrors** (boolean) - Optional - Include error information. - **withServiceLevel** (array of enums) - Optional - Service level details. ### Response #### Success Response (200) - **result** (object) - The normalized metadata object containing track details, services, artists, and albums. ``` -------------------------------- ### URL Lookup Response Example Source: https://musicfetch.io/docs/url A successful response returns a JSON object containing track metadata, including ISRC, duration, and service-specific links. ```json { "result": { "type": "track", "name": "Cruel Summer", "image": { 3 items }, "duration": 178426, "isrc": "USUG11901472", "isExplicit": false, "previewUrl": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/44/af/81/44af8168-9609-1b85-5048-ada08dceacf3/mzaf_1341699644335558812.plus.aac.p.m4a", "releaseDate": "2023-07-07T00:00:00.000Z", "label": "Taylor Swift", "genres": [ 1 item ], "copyright": "℗ 2019 Taylor Swift", "services": { 3 items }, "artists": [ 1 item ], "albums": [ 2 items ] } } ``` -------------------------------- ### GET /isrc Source: https://musicfetch.io/docs Lookup track metadata and streaming links using an ISRC code. ```APIDOC ## GET /isrc ### Description Lookup tracks using ISRC codes. ### Method GET ### Endpoint https://api.musicfetch.io/isrc ### Parameters #### Query Parameters - **isrc** (string) - Required - The ISRC code of the track. - **services** (string) - Optional - Comma-separated list of streaming services to include. ### Request Example curl https://api.musicfetch.io/isrc?isrc=USUG11901472&services=appleMusic \ -H 'x-token: YOUR_TOKEN' ``` -------------------------------- ### GET /upc Source: https://musicfetch.io/docs/upc Retrieves normalized release metadata and service links for a specific album or release identified by its UPC. ```APIDOC ## GET /upc ### Description Finds an album or release by Universal Product Code and returns normalized release metadata across music services. ### Method GET ### Endpoint https://api.musicfetch.io/upc ### Parameters #### Query Parameters - **upc** (string) - Required - The Universal Product Code of the release. - **services** (string) - Optional - A comma-separated list of music services to include in the response (e.g., appleMusic,youtube). ### Request Example curl "https://api.musicfetch.io/upc?upc=00602537618132&services=appleMusic,youtube" \ -H "x-token: YOUR_TOKEN" ``` -------------------------------- ### GET /isrc Source: https://musicfetch.io/docs/isrc Retrieves normalized recording metadata and service links for a specific track using its ISRC. ```APIDOC ## GET /isrc ### Description Finds a track by International Standard Recording Code (ISRC) and returns normalized recording metadata across music services. ### Method GET ### Endpoint https://api.musicfetch.io/isrc ### Parameters #### Query Parameters - **isrc** (string) - Required - The International Standard Recording Code of the track. - **services** (string) - Optional - A comma-separated list of streaming services to include in the response (e.g., appleMusic,youtube). ### Request Example curl "https://api.musicfetch.io/isrc?isrc=USUG11901472&services=appleMusic,youtube" \ -H "x-token: YOUR_TOKEN" ``` -------------------------------- ### GET https://api.musicfetch.io/upc Source: https://musicfetch.io/docs/upc Retrieves a normalized MusicfetchAlbum object containing matched album links and metadata for a given UPC. ```APIDOC ## GET https://api.musicfetch.io/upc ### Description Retrieves a normalized MusicfetchAlbum with matched album links and metadata from the requested music services when matches are available. ### Method GET ### Endpoint https://api.musicfetch.io/upc ### Parameters #### Query Parameters - **upc** (string) - Required - Universal Product Code (e.g. 00602547924766) - **services** (array of enums) - Required - A comma-separated list of music services to fetch matching data from. - **country** (enum) - Optional - The country to fetch local links for (e.g. US, GB, FR). - **withTracks** (boolean) - Optional - Include track information. - **withLyrics** (boolean) - Optional - Include lyrics information. - **withPerformance** (boolean) - Optional - Include performance information. - **withCredits** (boolean) - Optional - Include credits information. - **withErrors** (boolean) - Optional - Include error information. - **withServiceLevel** (array of enums) - Optional - Include service-level details. ### Response #### Success Response (200) - **result** (object) - The normalized album data including name, release date, label, tracks, and service links. #### Response Example { "result": { "type": "album", "name": "Pink Moon", "releaseDate": "1972-02-25T00:00:00.000Z", "label": "UMC (Universal Music Catalogue)", "totalTracks": 11, "upc": "00602438276004" } } ``` -------------------------------- ### Fetch album data by UPC Source: https://musicfetch.io/docs/upc Perform a GET request to the UPC endpoint to retrieve album metadata and service links. ```http GET https://api.musicfetch.io/upc ``` -------------------------------- ### GET https://api.musicfetch.io/search Source: https://musicfetch.io/docs/search Searches for tracks, albums, and artists by text query. Results include metadata that can be resolved further with URL lookup. ```APIDOC ## GET https://api.musicfetch.io/search ### Description Searches for tracks, albums, and artists by text query. Use this when you have names or partial metadata instead of a platform link, ISRC, or UPC. ### Method GET ### Endpoint https://api.musicfetch.io/search ### Parameters #### Query Parameters - **query** (string) - Required - Search query string - **country** (enum) - Optional - The country to fetch local links for (e.g., US, GB, FR) - **types** (array of enums) - Required - Comma-separated list of types to search (artist, album, track) ### Request Example curl "https://api.musicfetch.io/search?query=Taylor Swift&types=artist,album,track" \ -H "x-token: YOUR_TOKEN" ### Response #### Success Response (200) - **result** (object) - Contains lists of artists, albums, and tracks found. #### Response Example { "result": { "artists": [ 25 items ], "albums": [ 25 items ], "tracks": [ 25 items ] } } ``` -------------------------------- ### ISRC API Response Example Source: https://musicfetch.io/docs/isrc A sample JSON response returned by the ISRC lookup endpoint containing track metadata and service links. ```json { "result": { "type": "track", "name": "Oh, What A World", "image": { 3 items }, "duration": 241466, "isrc": "USUM71800131", "isExplicit": false, "previewUrl": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/a6/ad/a7/a6ada734-e559-5377-ceed-27d47ae10b3a/mzaf_15298078107429419622.plus.aac.p.m4a", "releaseDate": "2018-03-30T00:00:00.000Z", "label": "Lost Highway/IGA", "genres": [ 1 item ], "copyright": "℗ 2018 UMG Recordings, Inc.", "services": { 3 items }, "artists": [ 1 item ], "albums": [ 1 item ] } } ``` -------------------------------- ### GET https://api.musicfetch.io/isrc Source: https://musicfetch.io/docs/isrc Retrieves normalized track metadata and links from specified music services based on the provided ISRC. ```APIDOC ## GET https://api.musicfetch.io/isrc ### Description Retrieves a normalized MusicfetchTrack object with matched track links and metadata from requested music services using an ISRC. ### Method GET ### Endpoint https://api.musicfetch.io/isrc ### Parameters #### Query Parameters - **isrc** (string) - Required - International Standard Recording Code (e.g. USUG12200633) - **services** (array of enums) - Required - A comma-separated list of music services to fetch matching data from. - **country** (enum) - Optional - The country to fetch local links for (e.g. US, GB, FR). - **withLyrics** (boolean) - Optional - Include lyrics in the response. - **withDistributor** (boolean) - Optional - Include distributor information. - **withPerformance** (boolean) - Optional - Include performance data. - **withCredits** (boolean) - Optional - Include track credits. - **withErrors** (boolean) - Optional - Include error details. - **withServiceLevel** (array of enums) - Optional - Filter by service level. ### Response #### Success Response (200) - **result** (object) - The normalized MusicfetchTrack object containing track metadata, services, and artist information. #### Response Example { "result": { "type": "track", "name": "Oh, What A World", "duration": 241466, "isrc": "USUM71800131", "isExplicit": false, "releaseDate": "2018-03-30T00:00:00.000Z", "label": "Lost Highway/IGA" } } ``` -------------------------------- ### Lookup album by UPC using cURL Source: https://musicfetch.io/docs/upc Perform a GET request to the UPC endpoint with the required UPC parameter and authentication token. ```bash curl "https://api.musicfetch.io/upc?upc=00602537618132&services=appleMusic,youtube" \ -H "x-token: YOUR_TOKEN" ``` -------------------------------- ### Lookup track by ISRC using cURL Source: https://musicfetch.io/docs/isrc Perform a GET request to the ISRC endpoint with the required ISRC parameter and optional service filters. ```bash curl "https://api.musicfetch.io/isrc?isrc=USUG11901472&services=appleMusic,youtube" \ -H "x-token: YOUR_TOKEN" ``` -------------------------------- ### Initialize Musicfetch SDK Source: https://musicfetch.io/docs/sdk How to create an instance of the Musicfetch client using your API token. ```APIDOC ## Initialization ### Description Initialize the Musicfetch client with your API token to authenticate requests. ### Code Example ```javascript import Musicfetch from 'musicfetch'; // initialize once export const musicfetch = new Musicfetch({ token: YOUR_TOKEN, }); ``` ``` -------------------------------- ### Initialize Musicfetch Instance Source: https://musicfetch.io/docs/sdk Configure the SDK with your API token to create a reusable instance. ```javascript import Musicfetch from 'musicfetch'; // initialize once export const musicfetch = new Musicfetch({ token: YOUR_TOKEN, }); ``` -------------------------------- ### Lookup Music by URL Source: https://musicfetch.io/docs/sdk Fetch music metadata and links using a source URL. ```javascript import { musicfetch } from './my-musicfetch' const result = await musicfetch.url({ url: 'https://open.spotify.com/track/…', services: ['appleMusic', 'youtube'], }); ``` -------------------------------- ### Search music with cURL Source: https://musicfetch.io/docs/search Perform a search request using the cURL command-line tool. Replace YOUR_TOKEN with your actual API authentication token. ```bash curl "https://api.musicfetch.io/search?query=Taylor Swift&types=artist,album,track" \ -H "x-token: YOUR_TOKEN" ``` -------------------------------- ### Using Brand Assets Source: https://musicfetch.io/docs/sdk Access brand names, colors, and SVG icons provided by the SDK. ```APIDOC ## Brand Assets ### Description Use the bundled brand assets to build consistent UI components. ### Code Example ```javascript import brands from 'musicfetch/brands'; import { BrandIcon } from 'musicfetch/react'; const brand = brands.resolve(link); // Use brand.name, brand.color, or BrandIcon component ``` ``` -------------------------------- ### Perform URL Lookup Request Source: https://musicfetch.io/docs/url The endpoint accepts a source music URL and a list of target services to return normalized metadata. ```http GET https://api.musicfetch.io/url ``` -------------------------------- ### Lookup music by URL using cURL Source: https://musicfetch.io/docs/url Use this cURL command to resolve a Spotify track URL into Apple Music and YouTube links. ```bash curl "https://api.musicfetch.io/url?url=https://open.spotify.com/track/6habFhsOp2NvshLv26DqMb&services=appleMusic,youtube" \ -H "x-token: YOUR_TOKEN" ``` -------------------------------- ### Resolve and Display Brand Assets Source: https://musicfetch.io/docs/sdk Use the brands utility and React components to render brand-specific UI elements. ```javascript import brands from 'musicfetch/brands'; import { BrandIcon } from 'musicfetch/react'; const BrandCard = (link) => { // resolve brand from a link or key (eg. 'spotify') const brand = brands.resolve(link); return (

{brand.name}

); }; ``` -------------------------------- ### Lookup Music by URL Source: https://musicfetch.io/docs/sdk Fetch music metadata and links for a specific URL. ```APIDOC ## musicfetch.url(options) ### Description Lookup music information using a source URL. ### Parameters - **url** (string) - Required - The source URL (e.g., Spotify track link). - **services** (array) - Optional - List of services to fetch links for (e.g., ['appleMusic', 'youtube']). ### Code Example ```javascript const result = await musicfetch.url({ url: 'https://open.spotify.com/track/…', services: ['appleMusic', 'youtube'], }); ``` ``` -------------------------------- ### Search API endpoint definition Source: https://musicfetch.io/docs/search The base endpoint for performing music searches. ```http GET https://api.musicfetch.io/search ``` -------------------------------- ### Search Music Entities Source: https://musicfetch.io/docs/search Perform a search for artists, albums, or tracks based on a query string and country context. ```APIDOC ## GET /search ### Description Searches for music entities including artists, albums, and tracks based on the provided query. ### Parameters #### Query Parameters - **query** (string) - Required - The search query string. - **country** (string) - Optional - The country code to fetch local links for (e.g., US, GB, FR). - **types** (string) - Required - Comma-separated list of types to search (artist, album, track). ### Response #### Success Response (200) - **result** (object) - Contains lists of artists, albums, and tracks. #### Response Example { "result": { "artists": [], "albums": [], "tracks": [] } } ``` -------------------------------- ### Search API response structure Source: https://musicfetch.io/docs/search The JSON structure returned by the search endpoint, containing categorized lists of artists, albums, and tracks. ```json { "result": { "artists": [ 25 items ], "albums": [ 25 items ], "tracks": [ 25 items ] } } ``` -------------------------------- ### ISRC Lookup Endpoint Request Source: https://musicfetch.io/docs/isrc The base endpoint for performing an ISRC lookup. ```http GET https://api.musicfetch.io/isrc ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.