const apiUrl = 'https://itunes.apple.com' ; export function podcastSearch ( terms , limit ) { return fetch ( `${ apiUrl }/search?limit=${ limit }&media=podcast&term=${ terms }` ) ; } export function episodesSearch ( terms , limit ) { return fetch ( `${ apiUrl }/search?entity=podcastEpisode&limit=${ limit }&media=podcast&term=${ terms }` ) ; } export function getPodcast ( id ) { return fetch ( `${ apiUrl }/lookup?id=${ id }` ) ; } export function getPodcastEpisodes ( id , limit ) { return fetch ( `${ apiUrl }/lookup?id=${ id }&media=podcast&entity=podcastEpisode&limit=${ limit }` ) ; } export function artistSearch ( terms , limit ) { return fetch ( `${ apiUrl }/search?limit=${ limit }&media=music&entity=musicArtist&term=${ terms }` ) ; } export function albumSearch ( terms , limit ) { return fetch ( `${ apiUrl }/search?limit=${ limit }&media=music&entity=album&term=${ terms }` ) ; } export function musicSearch ( terms , limit ) { return fetch ( `${ apiUrl }/search?limit=${ limit }&media=music&entity=musicTrack&term=${ terms }` ) ; } export function artistDetailsSearch ( id , limit ) { return fetch ( `${ apiUrl }/lookup?limit=${ limit }&id=${ id }&entity=song` ) ; } export function artistAlbumsSearch ( id ) { return fetch ( `${ apiUrl }/lookup?id=${ id }&entity=album` ) ; } export function albumSongsSearch ( id , limit ) { return fetch ( `${ apiUrl }/lookup?limit=${ limit }&id=${ id }&entity=song` ) ; }