Spotify APi

Here’s the updated documentation with the revised instructions for obtaining an API key:


Spotify API Endpoint Documentation

Overview

The Spotify API endpoints allow users to search for tracks, artists, or albums and retrieve detailed information about each entity. You can access information such as the artist's name, song's popularity, the number of followers the artist has, and links to Spotify.

Base URL

https://connect.dinocoreapi.com/spotify

Endpoints

  1. Search Endpoint

    • URL: GET /search

    • Description: Allows searching for tracks, artists, or albums with detailed information.

    • Query Parameters:

      • q (required): The search query string (e.g., song title, artist name, album name).

      • type (optional): The type of item to search for. Defaults to track if not specified. Possible values:

        • track

        • album

        • artist

    • Request Headers:

      • Authorization: Bearer YOUR_API_KEY

    • Example Request:

      GET https://connect.dinocoreapi.com/spotify/search?q=Imagine&type=track
    • Response:

      • A JSON object containing an array of items with details such as:

        • artistName: The name of the artist.

        • songName: The name of the song.

        • popularity: The song's popularity score (0-100).

        • artistFollowers: The total number of followers the artist has.

        • songLink: A direct link to the song on Spotify.

    • Example Response:

      [
        {
          "artistName": "John Lennon",
          "songName": "Imagine",
          "popularity": 85,
          "artistFollowers": 12050000,
          "songLink": "https://open.spotify.com/track/7pKfPomDEeI4TPT6EOYjn9"
        },
        {
          "artistName": "Ariana Grande",
          "songName": "imagine",
          "popularity": 88,
          "artistFollowers": 74000000,
          "songLink": "https://open.spotify.com/track/3hB5DgAiMAQ4DzYbsMq1IT"
        }
      ]
  2. Track Information Endpoint

    • URL: GET /track/:id

    • Description: Retrieves detailed information about a specific track by ID.

  3. Artist Information Endpoint

    • URL: GET /artist/:id

    • Description: Retrieves detailed information about a specific artist by ID.

  4. Album Information Endpoint

    • URL: GET /album/:id

    • Description: Retrieves detailed information about a specific album by ID.

Error Responses

  • 400 Bad Request: If the q parameter is missing or improperly formatted.

  • 401 Unauthorized: If the API key is missing or invalid.

  • 500 Internal Server Error: If there is an issue with the Spotify API or the server.

Usage Notes

  • Access Token: The endpoint handles authentication with Spotify internally using the Client Credentials Flow. Users only need to provide a valid API key.

  • Rate Limiting: Spotify API rate limits apply. If you receive a 429 Too Many Requests response, reduce the frequency of your requests.

How to Obtain an API Key

To get access to the API key, please join our Discord server.

FAQ

  • Q: What types of searches can I perform?

    • A: You can search for tracks, albums, or artists using the type query parameter.

  • Q: How accurate is the popularity score?

    • A: The popularity score is provided by Spotify and is based on the number of recent plays and other factors.


Last updated