Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API from hosted instances? #81

Open
shub39 opened this issue Jan 14, 2025 · 3 comments
Open

API from hosted instances? #81

shub39 opened this issue Jan 14, 2025 · 3 comments

Comments

@shub39
Copy link

shub39 commented Jan 14, 2025

Hello 👋
I've been scraping Genius to get lyrics for my project Rush. Recently I stumbled upon this project and I was wondering if it is possible to get an API from the hosted instances to use in other apps? Thanks for this project 🙏

@fdezwonders
Copy link

Hello back! So, i wanna help you buuuuuut I'm a total beginner at coding, so i asked Claude to help 😅
AI response ⬇️


While dumb doesn't have an official API endpoint, I can suggest a couple of approaches based on the existing codebase:

  1. The project already has endpoints that fetch and parse Genius data, specifically:

    • /search - Search functionality (handlers/search.go)
    • /albums/{artist}/{albumName} - Album info
    • /artists/{artist} - Artist info
    • /{annotation-id}/{artist-song}/lyrics - Lyrics
  2. Looking at the code in handlers/lyrics.go and handlers/search.go, the service already parses and structures the data from Genius. You could make HTTP requests to any of the public instances listed in instances.json using these endpoints and parse the HTML response.

For example, you could use:

https://dm.vern.cc/search?q=your_search_term
[https://dm.vern.cc/{annotation-id}/{artist-song}-lyrics](https://dm.vern.cc/%7Bannotation-id%7D/%7Bartist-song%7D-lyrics)

However, please note that:

  1. Since this is primarily a web frontend, you'll need to parse the HTML responses
  2. Make sure to respect rate limits and add proper delays between requests
  3. Consider reaching out to instance operators if you plan heavy usage

For your Rush project, I'd recommend starting with a small proof of concept using one of the more stable instances from instances.json to see if this approach meets your needs.

@shub39
Copy link
Author

shub39 commented Feb 28, 2025

i wanted to avoid parsing html but seems like there's no choice 😃

@fdezwonders
Copy link

ai response ⬇️


Hey @shub39! Yeah, I get that parsing HTML isn’t ideal 😅, but unfortunately, since this project primarily serves as a frontend for Genius, there’s no direct API for structured data.

That said, the endpoints (/search, /lyrics, etc.) do return data you can work with, so you might be able to wrap it in your own lightweight API for easier integration into Rush. Just make sure to handle rate limits and check instance stability (maybe start with https://dm.vern.cc or others listed in instances.json). If you’re planning heavy usage, it’s a good idea to reach out to the instance operators for a heads-up. Hope this helps! 🙌


so yeah 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants