This API provides endpoints to search for podcasts and podcast episodes using the iTunes Search API. It's goal is to run.
Make sure that you have docker installed and run this on your commandline.
docker-compose up -d
The server will start on port 8000.
- URL:
/
- Method: GET
- Response: A simple "Hello, World!" string.
- URL:
/shows?term=<SEARCH_TERM>
- Method: GET
- Query Parameters:
- term: The search term for the podcast. (e.g., tech)
- Response: A JSON response with the search results from the iTunes API.
URL: /episodes?term=<SEARCH_TERM> Method: GET Query Parameters: term: The search term for the podcast episodes. (e.g., tech news) Response: A JSON response with the search results from the iTunes API.
-
searchPodcastShow(term string) ([]byte, error)
:- Accepts a search term as its parameter.
- Uses the iTunes Search API to find podcasts matching the search term.
- Returns the raw JSON response as bytes.
-
searchPodcastEpisodes(term string) ([]map[string]interface{}, error)
:- Accepts a search term as its parameter.
- Uses the iTunes Search API to find podcast episodes matching the search term.
- Parses the JSON response to extract the episode details.
- Returns a slice of map containing episode details.
For improved performance, the API utilizes goroutines to concurrently search for podcast shows and episodes. Results or errors from these goroutines are communicated back to the main routine using channels.