api.sillyangel.xyz
Find a file
2024-12-13 15:05:36 +00:00
src Update API documentation: add endpoints for referral codes and database clearing; enhance song and user songs sections 2024-12-13 15:05:36 +00:00
.gitignore Add .gitignore to exclude node_modules, environment files, and JSON data 2024-12-13 14:16:26 +00:00
package-lock.json Add package.json and README.md for song API setup and documentation 2024-12-13 14:16:33 +00:00
package.json Add package.json and README.md for song API setup and documentation 2024-12-13 14:16:33 +00:00
README.MD Enhance referral code functionality: add code generation limit and retrieval endpoint; update README for new features 2024-12-13 14:43:54 +00:00

/api/song

Description: Adds a song to the database and updates play counts.

Method: GET

Query Parameters:

  • song (string): The name of the song.
  • artists (string): The artists of the song.
  • album (string): The album of the song.
  • userID (string, optional): The ID of the user who played the song.

Response:

  • message (string): Confirmation message.
  • data (object): Details of the song added.

Example: GET /api/song?song=SongName&artists=ArtistName&album=AlbumName&userID=UserID

/api/user-songs

Description: Retrieves songs played by a specific user.

Method: GET

Query Parameters:

  • userID (string): The ID of the user.

Response:

  • message (string): Confirmation message.
  • data (array): List of songs played by the user.

Example: GET /api/user-songs?userID=UserID

/api/db/clear

Description: Clears the database if the correct key is provided.

Method: GET

Query Parameters:

  • key (string): The key to authorize the database clearing.

Response:

  • message (string): Confirmation message.

Example: GET /api/db/clear?key=

Referral Codes