You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API endpoints using the sidebar at left, or via the navigation bar on top of this page on smaller screens. In order to make successful Web API requests your app will need a valid access token. One can be obtained through OAuth 2.0. The base URI for all Web API requests is https://api.spotify.com/v1. Need help? See our Web API guides for more information, or visit the Spotify for Developers community forum to ask questions and connect with other developers.
This Motoko client was generated by the OpenAPI Generator project.
- API version: 1.0.0
- Generator version: 7.20.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.MotokoClientCodegen
- AddTracksToPlaylistRequest
- AlbumBase
- AlbumBaseAlbumType
- AlbumBaseReleaseDatePrecision
- AlbumBaseType
- AlbumObject
- AlbumRestrictionObject
- AlbumRestrictionObjectReason
- ArtistDiscographyAlbumObject
- ArtistDiscographyAlbumObjectAllOfAlbumGroup
- ArtistObject
- ArtistObjectType
- AudioAnalysisObject
- AudioAnalysisObjectMeta
- AudioAnalysisObjectTrack
- AudioFeaturesObject
- AudioFeaturesObjectType
- AudiobookBase
- AudiobookBaseType
- AudiobookObject
- AuthorObject
- CategoryObject
- ChangePlaylistDetailsRequest
- ChapterBase
- ChapterObject
- ChapterRestrictionObject
- ContextObject
- CopyrightObject
- CreatePlaylistRequest
- CurrentlyPlayingContextObject
- CursorObject
- CursorPagingObject
- CursorPagingPlayHistoryObject
- CursorPagingSimplifiedArtistObject
- DeviceObject
- DisallowsObject
- EpisodeBase
- EpisodeBaseReleaseDatePrecision
- EpisodeBaseType
- EpisodeObject
- EpisodeRestrictionObject
- ErrorObject
- ExplicitContentSettingsObject
- ExternalIdObject
- ExternalUrlObject
- FollowArtistsUsersRequest
- FollowPlaylistRequest
- FollowersObject
- GetAUsersAvailableDevices200Response
- GetAnAlbum401Response
- GetAnArtistsTopTracks200Response
- GetAvailableMarkets200Response
- GetCategories200Response
- GetCategories200ResponseCategories
- GetFollowed200Response
- GetMultipleAlbums200Response
- GetMultipleArtists200Response
- GetMultipleAudiobooks200Response
- GetMultipleEpisodes200Response
- GetMultipleShows200Response
- GetNewReleases200Response
- GetRecommendationGenres200Response
- GetSeveralAudioFeatures200Response
- GetSeveralChapters200Response
- GetUsersTopArtistsAndTracks200Response
- GetUsersTopArtistsAndTracks200ResponseAllOfItemsInner
- ImageObject
- IncludeExternal
- ItemType
- ItemType1
- ItemType2
- ItemTypeInner
- LinkedTrackObject
- NarratorObject
- PagingArtistDiscographyAlbumObject
- PagingArtistObject
- PagingFeaturedPlaylistObject
- PagingObject
- PagingPlaylistObject
- PagingPlaylistTrackObject
- PagingSavedAlbumObject
- PagingSavedEpisodeObject
- PagingSavedShowObject
- PagingSavedTrackObject
- PagingSimplifiedAlbumObject
- PagingSimplifiedAudiobookObject
- PagingSimplifiedChapterObject
- PagingSimplifiedEpisodeObject
- PagingSimplifiedShowObject
- PagingSimplifiedTrackObject
- PagingTrackObject
- PlayHistoryObject
- PlaylistObject
- PlaylistOwnerObject
- PlaylistTrackObject
- PlaylistTrackObjectTrack
- PlaylistTracksRefObject
- PlaylistUserObject
- PrivateUserObject
- PublicUserObject
- PublicUserObjectType
- QueueObject
- QueueObjectCurrentlyPlaying
- QueueObjectQueueInner
- RecommendationSeedObject
- RecommendationsObject
- RemoveEpisodesUserRequest
- RemoveTracksPlaylistRequest
- RemoveTracksPlaylistRequestTracksInner
- ReorderOrReplacePlaylistsTracks200Response
- ReorderOrReplacePlaylistsTracksRequest
- ResumePointObject
- SaveAlbumsUserRequest
- SaveEpisodesUserRequest
- SaveTracksUserRequest
- SaveTracksUserRequestTimestampedIdsInner
- SavedAlbumObject
- SavedEpisodeObject
- SavedShowObject
- SavedTrackObject
- Search200Response
- SectionObject
- SectionObjectMode
- SegmentObject
- ShowBase
- ShowBaseType
- ShowObject
- SimplifiedAlbumObject
- SimplifiedArtistObject
- SimplifiedAudiobookObject
- SimplifiedChapterObject
- SimplifiedEpisodeObject
- SimplifiedPlaylistObject
- SimplifiedShowObject
- SimplifiedTrackObject
- StartAUsersPlaybackRequest
- TimeIntervalObject
- TrackObject
- TrackObjectType
- TrackRestrictionObject
- TransferAUsersPlaybackRequest
- Type_
- UnfollowArtistsUsersRequest
- AlbumsApi
- ArtistsApi
- AudiobooksApi
- CategoriesApi
- ChaptersApi
- EpisodesApi
- GenresApi
- LibraryApi
- MarketsApi
- PlayerApi
- PlaylistsApi
- SearchApi
- ShowsApi
- TracksApi
- UsersApi
This is a Motoko module that can be used in your Internet Computer project.
Import the generated API modules in your Motoko code:
import SomeApi "mo:spotify-client/Apis/SomeApi";
// or using destructuring for specific functions
import { someFunction } "mo:spotify-client/Apis/SomeApi";Configure and call the API:
import { defaultConfig } "mo:spotify-client/Config";
// Use the default config as-is, or customize specific fields:
let config = { defaultConfig with auth = ?#bearer "my-token" };
let result = await* SomeApi.someFunction(config, ...);The defaultConfig has baseUrl pre-set to the API's base URL, cycles = 30_000_000_000, and all optional fields set to null.
Alternatively, use the suite-based API to bind config once and call multiple functions without threading it through each call:
import { SomeApi } "mo:spotify-client/Apis/SomeApi";
let api = SomeApi(config);
let result = await api.someFunction(...);
let other = await api.anotherFunction(...);The generated API client makes HTTP outcalls using the Internet Computer's management canister. HTTP outcalls require cycles to execute.
Important: Before calling any API endpoints, ensure your canister has sufficient cycles:
For local development:
# Get your canister ID
CANISTER_ID=$(dfx canister id your_canister_name)
# Add cycles (100 trillion cycles for testing)
dfx ledger fabricate-cycles --canister "$CANISTER_ID" --amount 100000000000000For production deployment, you'll need to fund your canister with cycles through the NNS or cycles wallet.
Each HTTP outcall typically costs around 20-50 million cycles depending on the request/response size.