Page 1 of 5

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 11:49 am
by Nomad
Image

This is good news! Thanks Thomas.

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 11:58 am
by Ralf
Great to see this project advancing!

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 3:49 pm
by kolbeck
hikoki wrote: Sun Mar 11, 2018 3:47 am Hi Thomas. Is there a way to sort new releases by date? year-month-day
[mention]hikoki[/mention]
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.

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 4:25 pm
by hikoki
^^^
Thanks!!
Is it possible to get a list from a certain month and year?

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 4:37 pm
by kolbeck
kolbeck wrote: Mon Mar 12, 2018 7:52 am
hikoki wrote: Sun Mar 11, 2018 1:29 pm 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
[mention]hikoki[/mention]

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

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 4:38 pm
by kolbeck
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

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 4:50 pm
by Ralf
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.

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 4:55 pm
by hikoki
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.

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 7:43 pm
by kolbeck
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.
[mention]hikoki[/mention] 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

Re: ZXDB based Open API

Posted: Wed Mar 21, 2018 10:24 pm
by kolbeck
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

Re: ZXDB based Open API

Posted: Fri Mar 23, 2018 8:53 pm
by kolbeck
IMPORTANT:

For now the API is https only, let me know if that's a problem.

/Thomas

Re: ZXDB based Open API

Posted: Sat Mar 24, 2018 3:29 am
by Einar Saukas
This API is awesome!!!

Also it's nice to see how much attention Thomas gives to people's suggestions and how fast he implements them. :)

This API is already being used by Dario's SpeccyBot, an interactive chat bot for Telegram that allows searching online for Spectrum related information. You can see it in action here:

Image

Unfortunately it's currently available in Spanish only. Hopefully it won't take too long to get an English version... For further information:

https://github.com/druellan/speccybot

Re: ZXDB based Open API

Posted: Sat Mar 24, 2018 9:11 am
by kolbeck
Thank you [mention]Einar Saukas[/mention] - part of openness is to pay attention to the users, this case (potentially) all of you.

Let me also inform, that from now on the ZXDB API is hosted on a professional web hosting / datacenter - to ensure top quality performance, stability & availability.

/Thomas

Re: ZXDB based Open API

Posted: Wed Mar 28, 2018 8:54 am
by kolbeck
Hello

The ZXInfo API has been updated to latest ZXDB as of March 28th.

Re: ZXDB based Open API

Posted: Wed Mar 28, 2018 12:23 pm
by Einar Saukas
That's fast! Thank you!

Re: ZXDB based Open API

Posted: Fri Mar 30, 2018 12:48 am
by kolbeck
New beta of ZXDB API has just been released. This version contains WIP of a Magazine focused API

Find more info here: https://api.zxinfo.dk/doc/

TLDR;
Quick examples of use:
List all magazines
https://api.zxinfo.dk/api/zxinfo/v2/mag ... t=name_asc

Show (short)issue info for Sinclair User
https://api.zxinfo.dk/api/zxinfo/v2/mag ... ser/issues

Show full info for issue-id 7 for Sinclair User
https://api.zxinfo.dk/api/zxinfo/v2/mag ... r/issues/7

Show only references in issue-id=7
https://api.zxinfo.dk/api/zxinfo/v2/mag ... references

Show only files in issue-id=7
https://api.zxinfo.dk/api/zxinfo/v2/mag ... es/7/files

Note: issue-id is the internal ZXDB issue-ID and can be found by using the .../issue method.

Better search for magazines is next on the list 8-)
/Thomas

Re: ZXDB based Open API

Posted: Fri Mar 30, 2018 10:57 pm
by Einar Saukas
Awesome! :)

Re: ZXDB based Open API

Posted: Tue Apr 03, 2018 7:28 pm
by druellan
This is awesome! Thanks both of you for making this possible :D

Image

Re: ZXDB based Open API

Posted: Thu Apr 05, 2018 9:11 pm
by kolbeck
API updated to ZXDB as per. 5th. April 2018 :-)

Re: ZXDB based Open API

Posted: Sat May 19, 2018 2:19 pm
by druellan
Hi! Quick question. What's the meaning of the "availability" property?

I thought it was referring to the fact that the game is available (or has permission) to be downloaded.

But if you search for new games using:

https://api.zxinfo.dk/api/zxinfo/v2/sea ... =Available

The list is not the same as using:

https://api.zxinfo.dk/api/zxinfo/v2/sea ... e=SOFTWARE

Not sure if this is a mistake or I'm confused about the meaning of this property.

Thanks!

Re: ZXDB based Open API

Posted: Sun May 20, 2018 7:57 am
by kolbeck
druellan wrote: Sat May 19, 2018 2:19 pm Hi! Quick question. What's the meaning of the "availability" property?

I thought it was referring to the fact that the game is available (or has permission) to be downloaded.

But if you search for new games using:

https://api.zxinfo.dk/api/zxinfo/v2/sea ... =Available

The list is not the same as using:

https://api.zxinfo.dk/api/zxinfo/v2/sea ... e=SOFTWARE

Not sure if this is a mistake or I'm confused about the meaning of this property.

Thanks!
The two queries are not the same, first one only search for "SOFTWARE" where availability status is Available, the other one search for any "SOFTWARE.

For more info on values for availablity, look at https://github.com/zxdb/ZXDB and in the section: Enumeration tables

/Thomas

Re: ZXDB based Open API

Posted: Sun May 20, 2018 12:08 pm
by druellan
HI kolbeck. And yes, exactly, but I think I was not clear enough about the problem. Mind, that is not a problem with your API, but probably something related to data entry. I've added this here because I can't check this information directly.

Let's try this:

This game: https://zxinfo.dk/details/0034299
Is missing the "available" tag, but, is ready for download, so, unless I'm confused about what "available" should indicate, I think it is.

Following that interpretation, If you look at both queries, many games added after "Go Race!" should be available, and are not.

Re: ZXDB based Open API

Posted: Tue May 22, 2018 7:50 am
by kolbeck
Hi

I vaguely remember this being discusses here before, maybe [mention]Einar Saukas[/mention] can remeber the thread with the discussion of "Availability"?

/Thomas

Re: ZXDB based Open API

Posted: Mon Jun 04, 2018 12:29 am
by Turrican
Hi kolbeck.
Sorry my ignorance but how can I take an image from a link?
For example: "cover_image":"/pub/sinclair/magazines/SinclairUser/Issue001/SUCover001.jpg" ?

Thank you.

Re: ZXDB based Open API

Posted: Mon Jun 04, 2018 12:42 am
by Einar Saukas
From ZXDB at GitHub:
Local file links starting with /pub/sinclair/ refer to content previously available at the original WorldOfSpectrum archive. These files are currently accessible from Archive.org mirror at https://archive.org/download/World_of_S ... /sinclair/

Local file links starting with /zxdb/sinclair/ refer to content added afterwards. These files are currently stored at https://spectrumcomputing.co.uk/zxdb/sinclair/