A New API

Posted in

#26 by Facenapalm
2022-11-10 at 15:53
< report >Greetings! Wikidata user here.

Any plans on filtering VN entries based on external links? Or at least adding external links to response fields? I've noticed there're some VNDb entries connected to Wikidata without a corresponding backlink from Wikidata to VNDb. I'm interested in getting the list of such entries.
#27 by Yorhel
2022-11-12 at 13:03
< report >I'm still trying to figure out how to expose the external links section, there's surprisingly many options to consider. In the mean time, I had already written a query some time ago to list all VNDB items without a Wikidata backlink. You could script around a CSV export of that, though it's not ideal for long-term automated synchronization.
#28 by Facenapalm
2022-11-12 at 23:41
< report >Thanks, this query is more than enough. Wasn't planning the long-term automated synchronization anyway, I was interested in analysis and probably one-time semi-automated import.

But it looks like the relation is too ambiguous to import external IDs automatically. I see some Wikidata items got linked from several VNDb entries (for instance, some VNDb entries are linked to video game series item, not the separate games items). I guess it makes sence if you want to have a link to Wikipedia article in the first place, but generally Wikidata is aiming at having a separate item for each entity.
#29 by Facenapalm
2022-11-13 at 00:36
< report >I have connected about 400 Wikidata items to VNDb tho. Cheers!
#30 by Yorhel
2022-11-13 at 07:03
< report >
I guess it makes sence if you want to have a link to Wikipedia article in the first place, but generally Wikidata is aiming at having a separate item for each entity.
We've found in many cases that Wikidata doesn't have a separate entitity for the VN. But where it does, yes, we certainly should link to the appropriate game entry and not the franchise.
#31 by Yorhel
2022-11-29 at 10:29
< report >Took a bit longer than I had planned, but the API now supports token-based authentication. Not super useful yet as the only thing this allows is reading private list items, but we've got to start somewhere.
#32 by avratzzz
2022-12-18 at 09:07
< report >Hi,

I used to run an web scrapping script for an VN leaderboard for 2 Japanese learning communities,
but now that these kind of script are banned, i'm forced to use the API now.
I used to get 2 informations from an list of user these are :
number of VN in a list label (Ex : Finished or an custom one), but i can't get this info with the API since the max is 100 and thus don't work with users who read more than 100 VN
(i don't need the VN list from that specified label just the count)
The other information i used to get was the total read/play time of an user, but as i can see in the docs it's impossible to get this info with the API rn (both new and old)

I want to now if it's possible to get theses now, or if it's planned to be added in the future
Thanks in advance for the help
#33 by Yorhel
2022-12-18 at 10:31
< report >
number of VN in a list label
I had a TODO open for that one, implemented now.

the total read/play time of an user
Hmmm, I hadn't considered this one yet, but I guess the 'GET /user' endpoint can be extended in a similar way. I'll do that later.
#34 by avratzzz
2022-12-19 at 08:04
< report >Thanks for the quick answer :D
i see that now in the docs /ulist_labels have an count propertiy in the HTTPS response
but when i try the request myself there's no count property in the response, i am missing something like an parameter in the request or it is just that the deployment haven't finished ?
#35 by Yorhel
2022-12-19 at 09:10
< report >Add the '?fields=count' parameter. I aim to make any information that has additional processing costs opt-in.
#36 by Yorhel
2022-12-19 at 15:15
< report >Play times added as well.

I don't expect any breaking changes to the API at this point so I've marked it as "stable" now. Change log will be added for upcoming changes from this point on. Still, it's missing a whole bunch of functionality, so if anyone needs a particular feature don't hesitate to ask so that I know what to prioritize.
#37 by avratzzz
2022-12-19 at 21:45
< report >Thanks for the amazing (and quick) updates :D
#38 by echo
2022-12-31 at 07:09
< report >Is it possible to filter releases on original language for the title, or do I need to pull all new releases first and then pull the associated VNs afterward and filter the data on my end if I want to do something like only showing JPN -> ENG releases?Last modified on 2022-12-31 at 07:09
#39 by Yorhel
2022-12-31 at 08:20
< report >You mean a filter on the linked VN's original language?

curl https://api.vndb.org/kana/release --header 'Content-Type: application/json' --data '{
"filters": [ "and",
[ "vn", "=", [ "olang", "=", "ja" ] ],
[ "lang", "=", "en" ]
],
"fields": "title,languages.lang"
}'
Should get you all JPN -> ENG releases.
#40 by echo
2022-12-31 at 08:54
< report >Thanks, looks like that should work!
#41 by db-ident-1
2023-01-10 at 08:25
< report >Is writing to a user's lists a planned feature? In the web UI you can directly add a release to your list which indirectly make the VN show up in one's list as "No label", quite useful for importing Steam/GOG releases to your list.

The original TCP API can not do this (it only allows VN to be modified), will it be possible in the new API?
#42 by Yorhel
2023-01-10 at 17:57
< report >The TCP API can't do it because nobody's asked for it, I think. If there's a demand I can implement it.

I'll have a look at a possible list management API tomorrow, been putting that off for long enough now. :/Last modified on 2023-01-10 at 17:58
#43 by Yorhel
2023-01-11 at 16:55
< report >Beta version of a list management API is available at the sandbox instance.
#44 by Yorhel
2023-01-17 at 08:08
< report >Alright then, list management API is live.
#45 by db-ident-1
2023-01-18 at 07:05
< report >"No label" visual novels in the list does not show up in the API response, any ideas?

Since my script will be blindly adding anything that presents in both the user's steam account and VNDB, I'd like them to remain in the "No label" category so that the importing operation does not mess up the user's existing list contents.

I don't want to keep a local database of all the owned games, so I'll be checking if the release is already present in the user's list and try to add that item. This makes sure that if the user set the status to anything other than "Obtained", my script does not overwrite that.Last modified on 2023-01-18 at 07:07
#46 by Yorhel
2023-01-18 at 07:12
< report >
"No label" visual novels in the list does not show up in the API response, any ideas?
List items are private unless a public label is assigned to them. They should show up if you fetch the list with a `listread` token.
#47 by db-ident-1
2023-01-18 at 07:25
< report >I have r30519 in my list, which should also make ACE Academy appear in my list (even though I never explicitly added that VN). They are not present when I use a token with all the permissions, an empty filter, and
"fields": "id,releases{id,list_status}"
#48 by Yorhel
2023-01-18 at 07:28
< report >I only see a single token active on your account and it doesn't have any permissions. Did you forget to hit the "Submit" button?
(...I should make that more obvious)

Reply

You must be logged in to reply to this thread.