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 »

ZXDB Open API updated to 25.02.2019 release.

The ZXDB contains some internal changes which affects the output from the API.

- Mod of / inspired by is now NxN relations, which means the "mod_of" property now is returned as an array.

Code: Select all

"mod_of": [
	{
		"id": "0003899",
		"is_mod": 1,
		"type": "Mod from",
		"title": "Project Future",
		"publisher": "Micromania",
		"machinetype": "ZX-Spectrum 48K"
	},
	{
		"id": "0009408",
		"is_mod": 1,
		"type": "Mod from",
		"title": "Sabre Wulf",
		"publisher": "Ultimate Play The Game",
		"machinetype": "ZX-Spectrum 48K"
	}
]
The "relationtype" is added to the output, taken directly from ZXDB (can be "Mod of" or "Inspired by"), will by next release replace the "is_mod" property, used in the old ZXDB structure.

/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 »

ZXDB Open API v1.5.0 has just been released.

https://api.zxinfo.dk/doc/

Added 'tiny' outputmode, containing the following properties:
  • fulltitle
    yearofrelease
    machinetype
    type + subtype (genre)
    publisher
    additionals (for screens)
Added API endpoint for fetching random SOFTWARE entries from the following categories:
  • Adventure Game
    Arcade Game
    Casual Game
    Game
    Sport Game
    Strategy Game
Are these changes essential? Not really, but they are required in my upcoming project :o

/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 kolbeck!
A doubt: I updated the ZX App with Downloads Tab where we can download any software on the external storage of our device.
Old softwares are in the "releases" section where I´m getting the urls.
But new softwares are in the "additionals" section.
How can I know if I have to take url from releases or additionals?

Thank you!
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] - thanks for the observations :-)

The 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. The API used this information to determine if a file has to be in the release part or the additional section.

I'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.

So for now, you can assume that the software for an entry is to be found in the release section - otherwise let me know of any cases where this does not apply.

/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 »

Great!!!
Now we get all downloads.
Thank you very much!
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
Locked