Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/devlocalhost/pylyrical_api

pylyrical_api - lyrics API scraping from genius.com
https://github.com/devlocalhost/pylyrical_api

beautifulsoup beautifulsoup4 bs4 genius genius-api genius-lyrics genius-lyrics-api lyrics lyrics-api lyrics-fetcher lyrics-finder lyrics-scraping python python-3 python3 scraping scraping-python scraping-websites

Last synced: about 1 month ago
JSON representation

pylyrical_api - lyrics API scraping from genius.com

Awesome Lists containing this project

README

        

# pylyrical_api
pylyrical_api - lyrics API scraping from genius.com

# API Token
To self-host, you need to get an API token from the [api client page](https://genius.com/api-clients). You can then add the API token to a ".env" file. Example: `GENIUS_API_TOKEN="T0K3N"`

# Usage
- API endpoint: /lyrics
- Acceptable parameters: q
- Example: /lyrics?q=how+do+i+make+you+love+me+the+weeknd

Responses
- 200
```json
{
"artists": "",
"lyrics": "",
"source": "",
"status": "200",
"title": ""
}
```

- 400
```json
{
"exception":
"NoParameter",
"message": "Missing parameter 'q'.",
"status": "400"
}
```

- 404
```json
{
"exception": "NoResults",
"message": "'' did not give any results, Please try a different term.",
"status": "404"
}
```

- 500
```json
{
"exception": "ScrapeError",
"message": "",
"status": "500"
}
```

- 502
```json
{
"exception": "RequestConnectionError",
"message": "",
"status": "502"
}
```

# Exceptions/Errors
- NoParameter: Occurs when no parameter was given.
- Returns status code 400.
- NoResults: Occurs when no results were found.
- Returns status code 404.
- ScrapeError: Occurs when pylyrical cannot scrape lyrics from genius.com
- Returns status code 500.
- RequestConnectionError: Occurs when pylyrical cannot send a request to genius.com
- Returns status code 502.