Jump to content
JohnLM

Are there anyone using discogs API?

Recommended Posts

The purpose of using this API is for pulling just the "artist release date". I am not using the REST that comes with Delphi yet, but I probably should and will eventually.  I just need the artist release date for now. And I can pull that info from the JSON.

 

https://www.discogs.com/developers/#page:database,header:database-search-get

 

But. . . I'm having trouble trying to test the demo.  I have the two keys they sent, but the guide(s) I am reading do not include the whole API string, and its confusing.  I've never had this much difficulty with API's. 

 

I need to format the "fetch" part (below) into a full one-line string that I can paste into the URL box in a webbrowser. 

 

fetch('https://api.discogs.com/releases/1', {
  headers: { 'Authorization': 'Discogs key=[YOUR_KEY],secret=[YOUR_SECRET]' }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

 

Edited by JohnLM

Share this post


Link to post

Okay. I finally figured it out and its working. 

Share this post


Link to post

Update. . .

 

Initially, I was trying to set up a TWebbrowser on a form (and a button/edit controls) but I was getting script errors.  Well, not from javascript, but two pop-up download for the JSON file.  If I select Open, it will open in notepad. But this was too cumbersome. 

 

But I finally did get it to work in a basic web browser window made in delph using the TEdgeBrowser component, using D12.0, and the API worked and displayed.

 

Next, I will figure out how to build a crude JSON parser to just snip the {"Country" : "US", "Year" : value} for now. 

 

0202_eforum_discorgs_Edgebrowser_api_demo.thumb.png.59d5038eba7292f2e462720a935d94b8.png

 

Note: I had to delete the app name/key because I posted that in the last image by mistake. I created a new app name/key. 

 

Edited by JohnLM

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×