How to search Spotify for Artists, Albums, Tracks, Playlists, Shows, Episodes and Audiobooks
SearchSpotify
There is just one formula to search for anything!
SearchSpotify() formula is a powerful tool that allows you to search for various types of items on Spotify directly within your Coda doc. Whether you're looking for albums, tracks, artists, playlists, shows, episodes, or audiobooks, this formula provides a convenient way to find the desired content.
Parameters
account (connected account): The Spotify account used to pull in the data.
query (string): The search query you want to perform. This can be any relevant keywords, such as the name of an artist, album, track, playlist, show, episode, or audiobook.
types (string, optional): A comma-separated list of item types you want to include in the search results. Valid types are: artist, album, track, playlist, show, episode, and audiobook. If not provided, the formula will search across all supported item types.
limit (number, optional): The maximum number of results to return for each item type. If not specified, the formula will use a default limit of 20 results per type.
Returns
The SearchSpotify() formula returns an object containing the search results, organized by item type. The object has the following properties:
albums (array): An array of album objects matching the search query.
tracks (array): An array of track objects matching the search query.
artists (array): An array of artist objects matching the search query.
playlists (array): An array of playlist objects matching the search query.
shows (array): An array of show objects matching the search query.
episodes (array): An array of episode objects matching the search query.
audiobooks (array): An array of audiobook objects matching the search query.
Each item object contains relevant details such as the item's name, ID, URL, and other metadata specific to the item type. See the
The SearchSpotify() formula provides a flexible and efficient way to discover and explore various types of content on Spotify. By leveraging this formula, you can easily integrate Spotify search capabilities into your Coda docs, enabling you to find and reference relevant music, podcasts, and audiobooks in your projects.
Result Types
When using the formula’s types: option in SearchSpotify(), the types must be formatted specifically how Spotify wants them (lowercase, and in singular form). For example, when searching for Artists and Albums, you would use types: “artist,album”
This table below that has a regular “name” column (styled like “Artists”), and a spotifyFormat column. In the example pages, I use this table to help allow the user to select from a dropdown (of relations to the
You can narrow down your search using field filters. The available filters are album, artist, track, year, upc, tag:hipster, tag:new, isrc, and genre. Each field filter only applies to certain result types.
The artist and year filters can be used while searching albums, artists and tracks.
You can filter on a single year or a range (e.g. 1955-1960).
The album filter can be used while searching albums and tracks.
The genre filter can be used while searching artists and tracks.
The isrc and track filters can be used while searching tracks.
The upc, tag:new and tag:hipster filters can only be used while searching albums.
The tag:new filter will return albums released in the past two weeks and tag:hipster can be used to return only albums with the lowest 10% popularity.