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.
User avatar
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: ZXDB based Open API

Post by Nomad » Wed Mar 21, 2018 11:49 am

Image

This is good news! Thanks Thomas.
1 x

Ralf
Manic Miner
Posts: 782
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: ZXDB based Open API

Post by Ralf » Wed Mar 21, 2018 11:58 am

Great to see this project advancing!
0 x

User avatar
kolbeck
Dizzy
Posts: 50
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck » Wed Mar 21, 2018 3:49 pm

hikoki wrote:
Sun Mar 11, 2018 3:47 am
Hi Thomas. Is there a way to sort new releases by date? year-month-day
@hikoki
Yes, just added 'sort' parameter to search (defaults to newest first) - see more at http://api.zxinfo.dk/doc/#!/zxinfo/searchAndFilter

To get newest 10 releases (SOFTWARE) just do this call: (in fact mode & sort can be left out, as default values are compact & date_desc)

http://api.zxinfo.dk/api/zxinfo/v2/sear ... 0&offset=0

BTW: Also updated to latest ZXDB just released.
0 x
https://zxinfo.dk - another ZXDB frontend
https://api.zxinfo.dk/doc/ - ZXDB API for developers

hikoki
Manic Miner
Posts: 251
Joined: Thu Nov 16, 2017 10:54 am

Re: ZXDB based Open API

Post by hikoki » Wed Mar 21, 2018 4:25 pm

^^^
Thanks!!
Is it possible to get a list from a certain month and year?
0 x

User avatar
kolbeck
Dizzy
Posts: 50
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck » Wed Mar 21, 2018 4:37 pm

kolbeck wrote:
Mon Mar 12, 2018 7:52 am
hikoki wrote:
Sun Mar 11, 2018 1:29 pm
hikoki wrote:
Sun Mar 11, 2018 3:47 am
Hi Thomas. Is there a way to sort new releases by date? year-month-day
Apart from Updates sorted by date, it would be nice getting a number of random games from any result list. Something like display only 5 random games from any narrowed query.
The frontpage of ZXInfo already does that but it's not part of the API. Putting it on the TODO list

https://github.com/thomasheckmann/zxinf ... s/issues/3

/Thomas
@hikoki

To get random results, use offset=random (size specifies number of documents, max 10 at the moment)
For example to fetch 8 random entries matching 'miner' use this call - try refresh browser :-)

http://api.zxinfo.dk/api/zxinfo/v2/sear ... set=random

/Thomas
0 x
https://zxinfo.dk - another ZXDB frontend
https://api.zxinfo.dk/doc/ - ZXDB API for developers

User avatar
kolbeck
Dizzy
Posts: 50
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck » Wed Mar 21, 2018 4:38 pm

hikoki wrote:
Wed Mar 21, 2018 4:25 pm
^^^
Thanks!!
Is it possible to get a list from a certain month and year?
Not official, but I'll look into it :-)

/Thomas
0 x
https://zxinfo.dk - another ZXDB frontend
https://api.zxinfo.dk/doc/ - ZXDB API for developers

Ralf
Manic Miner
Posts: 782
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: ZXDB based Open API

Post by Ralf » Wed Mar 21, 2018 4:50 pm

Is it possible to get a list from a certain month and year?
Remember that 99% of titles won't have any data about month of release.
0 x

hikoki
Manic Miner
Posts: 251
Joined: Thu Nov 16, 2017 10:54 am

Re: ZXDB based Open API

Post by hikoki » Wed Mar 21, 2018 4:55 pm

Thanks Thomas.
Many thanks again!!
To be frank, I don't know how to get a list of a certain year. Looking into months is just an interesting curiosity.

Yes, Ralf. I'd say that even dates have not been taken into account in some games from last years.
0 x

User avatar
kolbeck
Dizzy
Posts: 50
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck » Wed Mar 21, 2018 7:43 pm

hikoki wrote:
Wed Mar 21, 2018 4:55 pm
Thanks Thomas.
Many thanks again!!
To be frank, I don't know how to get a list of a certain year. Looking into months is just an interesting curiosity.

Yes, Ralf. I'd say that even dates have not been taken into account in some games from last years.
@hikoki I've added 'year' as an option, for example to search for 'Andrew' in 2017 releases use:

http://api.zxinfo.dk/api/zxinfo/v2/sear ... 0&offset=0

As Ralf mentioned only a very tiny part of entries have month & day info, so I decided it was not worth adding these as filters - however the sort options will take them into consideration, if they exist.

/Thomas
1 x
https://zxinfo.dk - another ZXDB frontend
https://api.zxinfo.dk/doc/ - ZXDB API for developers

User avatar
kolbeck
Dizzy
Posts: 50
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZXDB based Open API

Post by kolbeck » Wed Mar 21, 2018 10:24 pm

So sum up ZXInfo API v1.3.0 has been released at http://api.zxinfo.dk/doc/

Different level of output details
All methods support a mode flag for output. Mode can be full or compact, and default is compact
For methods returning a single entry, compact mode returns the following fields:
fulltitle, yearofrelease, monthofrelease, dayofrelease, machinetype, numberofplayers, multiplayermode, multiplayermode, type, subtype, isbn, messagelanguage, originalprice, availability, knownerrors, remarks, spotcomments, score, publisher, releases, authors, roles, authored, authoring, controls, series, othersystems, contents, incompilations, booktypeins, additionals, mod_of, modified_by
For methods returning multiple entries, compact mode returns the following fields:
fulltitle, yearofrelease, monthofrelease, dayofrelease, type, subtype, authors, publishers, machinetype
Sorting
For methods returning multiple entries a sort flag is supported to specify sort order. Sort order can be:
  • title_asc - sort by title ascending
  • title_desc - sort by title descending
  • date_asc - sort by date (year, month, day) ascending (oldest first)
  • date_desc - sort by date (year, month, day) descending (newest first)
By default date_desc is used.

Display X random entries
The search method now supports returning X random entries from the search. Use size and offset to control result:
  • offset=random - return random documents
  • size=n - number of documents to return, max value for n is 10
New search filters
For the search method the following filters are added:
  • year - filter by release year
  • language - filter by messagelanguage
More flexible ID parsing
The method getGameById now supports id with less than 7 digits. It also handles invalid id and nothing found by returning http status 400 & 404

No more timeout if size or offset is missing
Parameters are now required for all methods returning multiple entries, and can be used for pagination.

/Thomas
2 x
https://zxinfo.dk - another ZXDB frontend
https://api.zxinfo.dk/doc/ - ZXDB API for developers

Post Reply