ZXDB based Open API

This is the place for general discussion and updates about the ZXDB Database. This forum is not specific to Spectrum Computing.

Moderator: druellan

User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

You're welcome :-)

I'm this far for now.... hehe

Image
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Turrican
Microbot
Posts: 187
Joined: Thu Apr 12, 2018 5:48 pm
Location: Brazil

Re: ZXDB based Open API

Post by Turrican »

Great!!
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: ZXDB based Open API

Post by Einar Saukas »

kolbeck wrote: Mon Mar 04, 2019 7:55 pmThe short explanation is that in old WOS data, each "game release" is linked to a machine type - this is not the case in ZXDB. I guess the reason is that this would require a one-to-many relation and a restructure of the database model.
What do you mean?

kolbeck wrote: Mon Mar 04, 2019 7:55 pmI've changed the logic, so now the API assumes if the file is on of the known "game" formats. such as tap, tzx, disk image etc. it belongs to the release section, otherwise the additional part. Not perfect - but at least it seems to be working for all my test cases.
Instead of file format, it's more reliable to check file type:

Code: Select all

filetype_id IN (46, 47) OR filetype_id BETWEEN 8 AND 22
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

Einar Saukas wrote: Tue Mar 05, 2019 12:19 pm
kolbeck wrote: Mon Mar 04, 2019 7:55 pmThe short explanation is that in old WOS data, each "game release" is linked to a machine type - this is not the case in ZXDB. I guess the reason is that this would require a one-to-many relation and a restructure of the database model.
What do you mean?
I used the machinetype_id in the downloads table, however it looks like its only valid for the old WOS entries. All new downloads (software) added to ZXDB seems to have machinetype_id set to NULL.

However, it's not a big problem - i will just use your suggested where clause instead :-)

/T
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Turrican
Microbot
Posts: 187
Joined: Thu Apr 12, 2018 5:48 pm
Location: Brazil

Re: ZXDB based Open API

Post by Turrican »

Hi [mention]kolbeck[/mention] !
One doubt: I´m getting trouble to get the front inlay image of the cassetes.
Sometimes I get the back inlay, sometimes the inside inlay... because there is no order on images.
Example:
Pit Fighter has the front inlay in the 2nd image:
/zxdb/sinclair/entries/0003742/Pit-Fighter_Back.jpg
/zxdb/sinclair/entries/0003742/Pit-Fighter_Front.jpg

And Out Run is on the first image:
/pub/sinclair/games-inlays/o/OutRun.jpg
/pub/sinclair/games-inlays/o/OutRun_2.jpg
/pub/sinclair/games-inlays/o/OutRun_Inside.jpg

Is there a way where the front inlay is always the first one?

Thanks!
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

Hi,

From what I can see, ZXDB (or old WoS) didn't have detailed information about inlays, either it's an inlay or not. However I think there was something about the filenaming for ZXDB, where the filename indicates the type of inlay. You will see it on the /zxdb/ files, as these are added to ZXDB.

Maybe [mention]Einar Saukas[/mention] has a better idea of how to classify the inlays?

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

A new year - and finally ZXInfo API has been updated with latest ZXDB release :D

Starting here in 2020 I'm also happy to announce that ZXInfo API got a new client, the multi-machine emulator ZEsarUX has a new Spectrum online game browser using the ZXInfo API to search and query game data. The online browser is availabel from ZEsarUX-8.1 beta 1. Find more information and latest release here: https://github.com/chernandezba/zesarux/releases

This brings the number of official ZXInfo API clients up to 5 - ranging from web sites to android and tv apps - HAPPY NEW YEAR!
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

Another update, the ZXInfo API has been updated with latest release of ZXDB (04.03.2020 release).

Ta da...

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: ZXDB based Open API

Post by Einar Saukas »

kolbeck wrote: Fri Jan 03, 2020 5:08 pm Starting here in 2020 I'm also happy to announce that ZXInfo API got a new client, the multi-machine emulator ZEsarUX has a new Spectrum online game browser using the ZXInfo API to search and query game data. The online browser is availabel from ZEsarUX-8.1 beta 1. Find more information and latest release here: https://github.com/chernandezba/zesarux/releases

This brings the number of official ZXInfo API clients up to 5 - ranging from web sites to android and tv apps - HAPPY NEW YEAR!
I forgot to reply about it... This is fantastic! :)
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

Hello out there...

Just a small update on the API. As part of my clean up and other maintenance, a few new endpoints have been added to the API.

* metadata - some help to search for the right values
* suggest - a helper for implementing autocomplete and autosuggestion
* graph path - Six degrees of separation between two names

The API documentation has been update, in case you want to try it out. Find it here: https://api.zxinfo.dk/doc/

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Turrican
Microbot
Posts: 187
Joined: Thu Apr 12, 2018 5:48 pm
Location: Brazil

Re: ZXDB based Open API

Post by Turrican »

Hi [mention]kolbeck[/mention] .
PM sent!

:)
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

[mention]Turrican[/mention] nothing there, did you press the ‘send’ button? :-)
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

The ZXDB Open API has been updated with latest ZXDB release.

Together with this update, a few new endpoints also found its way. The new endpoints are helpers for implementing autosuggestion/autocomplete:
* suggest (creates suggestions on titles, publisher and authors)
* suggest author (creates suggestions on author only)
* suggest publisher (creates suggestions on publisher only)

Too see them in action, take a look at https://zxinfo.dk

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

The ZXDB Open API has been updated with latest ZXDB release 14.07.2020

/T
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Pobulous
Dynamite Dan
Posts: 1346
Joined: Wed Nov 15, 2017 12:51 pm

Re: ZXDB based Open API

Post by Pobulous »

I get a 404 on the doc link - https://api.zxinfo.dk/doc/
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

Remove /doc/
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

Hi,

Just a small sign of life post :-)
ZXInfo are updated on regular basis with ZXDB releases, and as part of the updates a more detailed change log are published as well on https://api.zxinfo.dk - for example have a look here: https://api.zxinfo.dk/changelogs/change ... 102020.txt (remember, the change log describes how the ZXDB update impacts ZXInfo).

The future?
Besides fixing issues, work has begun on a major refactor / cleanup. The JSON structure used goes way back to 2016 and has been extended to fix changes in the structure of ZXDB on ad-hoc basis. It is now time to cleanup and make the data more lean and efficient for the clients. One day during the beginning of 2021 the new format together with updated API endpoints will be available. When the new API will be announced, the current will be deprecated - BUT will be running for a period of time in order for everyone to catch up, it will probaly be around 6 months before shutting down the old API.
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
moroz1999
Manic Miner
Posts: 329
Joined: Fri Mar 30, 2018 9:22 pm

Re: ZXDB based Open API

Post by moroz1999 »

Thank you! I'm planning to integrate ZX-Art with api.zxinfo.dk. Connecting to API is much easier than manual importing of a large database to ZX-Art's hosting and running the syncronization each time I remember about updates :)
So looking forward to a new format, let's make an automatization.
User avatar
arjun
Microbot
Posts: 147
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: ZXDB based Open API

Post by arjun »

kolbeck wrote: Tue Nov 03, 2020 8:19 am
ZXInfo are updated on regular basis with ZXDB releases, and as part of the updates a more detailed change log are published as well on https://api.zxinfo.dk - for example have a look here: https://api.zxinfo.dk/changelogs/change ... 102020.txt (remember, the change log describes how the ZXDB update impacts ZXInfo).
I was wondering if it would be useful to have an endpoint that returns the list of all game titles and their wos_id (since that seems to be the search term for games) in the zxdb? Just these two fields - game title and the id. Might be useful if someone wanted to write a front-end that could look up any game in the db directly without having to search for it first.
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

As promised, 2021 marks the beginning of the next generation of ZXInfo API. The JSON format returned by the API has been updated to be more streamlined to the structure and changes in ZXDB. Some cleaning has been done as well - for example to remove duplicated properties, enhanced with additional information such as Awards info, Publisher and Author notes, and in general property names are changed to camelCase.

If you want to have a sneak-peak at the new structure, please head to ZXInfo API v3

The different endPoints will be added in the upcoming time, as they need to be adjusted to the new format, but for now you can play with the "getGameById" endpoint to retrieve the data for entries.

The API v3 will be considered released, the day ZXInfo Website has been switched to API v3 - and I will let you know, as that will be the day the current API will enter deprecated state. Don't worry, expect at least 6 months period until it is closed down :-)

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

arjun wrote: Mon Dec 14, 2020 6:11 pm I was wondering if it would be useful to have an endpoint that returns the list of all game titles and their wos_id (since that seems to be the search term for games) in the zxdb? Just these two fields - game title and the id. Might be useful if someone wanted to write a front-end that could look up any game in the db directly without having to search for it first.
You mean lookup the title by ID?

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: ZXDB based Open API

Post by Einar Saukas »

arjun wrote: Mon Dec 14, 2020 6:11 pmI was wondering if it would be useful to have an endpoint that returns the list of all game titles and their wos_id (since that seems to be the search term for games) in the zxdb?
Since even WoS uses ZXDB now, the appropriate search term should really be zxdb_id!
User avatar
arjun
Microbot
Posts: 147
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: ZXDB based Open API

Post by arjun »

kolbeck wrote: Tue Jan 26, 2021 10:57 pm
arjun wrote: Mon Dec 14, 2020 6:11 pm I was wondering if it would be useful to have an endpoint that returns the list of all game titles and their wos_id (since that seems to be the search term for games) in the zxdb? Just these two fields - game title and the id. Might be useful if someone wanted to write a front-end that could look up any game in the db directly without having to search for it first.
You mean lookup the title by ID?

/Thomas
Yes, the zxdb_id. ;)
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck »

Something like this?

Code: Select all

sh-3.2$ curl https://api.zxinfo.dk/v3/games/0002259?mode=titleonly && echo ""
Head over Heels
sh-3.2$
Or in a browser (why would you do that?)
https://api.zxinfo.dk/v3/games/0002259?mode=titleonly

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
arjun
Microbot
Posts: 147
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: ZXDB based Open API

Post by arjun »

Ah.. not exactly. Perhaps what I'm proposing isn't feasible but this is what I had in mind:

https://api.zxinfo.dk/v3/games/A

This returns all games starting with A, but only their zxdb_id and title and nothing else. What use is this? Remember the old WoS UI, which had all the letters in the alphabet on top? Clicking them would list a paginated result of all the software of that alphabet. Now, imagine an app that not only allowed you to search for a game (using the search query in zxinfo), but if a user selects an alphabet from a drop down or whatever, it lists all the titles starting with that letter.

Does that make sense? Is there a way to do this already?
Locked