Re: [Wikidata-l] Autocomplete API for a search field in an external app

2014-04-29 Thread Thomas Steiner
Hi Maxime,

After some quick reverse engineering of the site with the Chrome
Developer Tools, here's the API it is using:

http://www.wikidata.org/w/api.php
?callback=[YOUR CALLBACK NAME]
&action=wbsearchentities
&format=json
&language=en
&type=item
&continue=0
&_=[TIMESTAMP (as a cache buster)]
&search=[YOUR QUERY]

If you don't need the callback, then the API is as follows (note the
missing cache buster):

http://www.wikidata.org/w/api.php
&action=wbsearchentities
&format=json
&language=en
&type=item
&continue=0
&search=[YOUR QUERY]

Hope this helps.

Best,
Tom

-- 
Thomas Steiner, Employee, Google Inc.
http://blog.tomayac.com, http://twitter.com/tomayac

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck0fjumBl3DCharaCTersAttH3b0ttom.hTtP5://xKcd.c0m/1181/
-END PGP SIGNATURE-

___
Wikidata-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


Re: [Wikidata-l] Autocomplete API for a search field in an external app

2014-04-29 Thread Thomas Steiner
Small correction:

> If you don't need the callback, then the API is as follows (note the
> missing cache buster):
>
> http://www.wikidata.org/w/api.php
> &action=wbsearchentities
?action=wbsearchentities (replace '&' with '?', copy and paste
oversight, sorry).

-- 
Thomas Steiner, Employee, Google Inc.
http://blog.tomayac.com, http://twitter.com/tomayac

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck0fjumBl3DCharaCTersAttH3b0ttom.hTtP5://xKcd.c0m/1181/
-END PGP SIGNATURE-

___
Wikidata-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


Re: [Wikidata-l] Autocomplete API for a search field in an external app

2014-04-29 Thread Christian Dullweber
Hi,

the autocomplete box is using the wbsearchentities api. You could try to
copy the jquery.wikibase.entityselector.js from
wikibase/lib/resources/jquery.wikibase it looks like it works independently
from wikibase. It needs the jqueryui suggester.

best regards,

Christian



2014-04-28 18:40 GMT+02:00 Maxime Lathuilière :

>  Hi,
>
> I'm looking for a way to reproduce the autocomplete on wikidata search
> field in an external app (to tag resources with wikidata entities ids), but
> so far I couldn't find what could allow me to do this in the API doc.
> In a little experiment ,
> I tried to use the API action *wbsearchentities*, but it appear to be
> inefficient until I reach the full name... Is there already a way to query
> such an "autocomplete API" or any plans to implement one? Or even better,
> is there a way to easily re-use the wikidata search field widget? in a
> non-PHP project? :D
>
> Any clue welcome :)
>
> Best regards,
>
> Max
>
> --
>
>
> Maxime Lathuilière
> maxlath.eu
> @maxlath
> Zorglub27 
> Contributions
>
> ___
> Wikidata-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/wikidata-l
>
>
___
Wikidata-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


[Wikidata-l] Autocomplete API for a search field in an external app

2014-04-28 Thread Maxime Lathuilière
Hi,

I'm looking for a way to reproduce the autocomplete on wikidata search
field in an external app (to tag resources with wikidata entities ids),
but so far I couldn't find what could allow me to do this in the API doc.
In a little experiment
, I tried to use the
API action /wbsearchentities/, but it appear to be inefficient until I
reach the full name... Is there already a way to query such an
"autocomplete API" or any plans to implement one? Or even better, is
there a way to easily re-use the wikidata search field widget? in a
non-PHP project? :D

Any clue welcome :)

Best regards,

Max

-- 


Maxime Lathuilière
maxlath.eu 
@maxlath
Zorglub27 
Contributions

___
Wikidata-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-l