Support

Wikisearch API reference

Looking for Wikipedia pages but don't know their exact title?
We can help you to search for the page you want.

You can also test Wikisearch from the demo page, at wikisearch.dandelion.eu

Endpoint

https://api.dandelion.eu/datagraph/wikisearch/v1

Parameters

Remember to authenticate yourself specifying the token parameter (or the legacy $app_id and $app_key pair). See the API doc about authentication for any questions.

text required
A string that you want to be matched against Wikipedia.
Type string
Example text=tower of big ben
lang required
The language of the string to be searched; currently English, French, German, Italian, Portuguese and Spanish are supported.
Type string
Default value en
Accepted values de | en | es | fr | it | pt
limit optional
Restricts the output to the first N results.
Type integer
Default value 10
Accepted values 1 .. 50
offset optional
Starts listing the results from the given index. Mostly used in combination with limit parameter, for pagination purposes.
Type integer
Default value 0
query optional
With this parameter you can choose the behaviour of the search. If you want to search for all the entities that:
  • contain the text: use full;
  • start with the text: use prefix

The prefix option is very useful in autocomplete scenarios.

Type string
Default value full
Accepted values full | prefix
include optional
Returns more information on annotated entities:
  • "types" adds type information from DBpedia or dandelion. DBpedia types are extracted based on the lang parameter (e.g. if lang=en, types are extracted from DBpedia english). Please notice that different DBpedia instances may contain different types for the same resource;
  • "categories" adds category information from DBpedia/Wikipedia;
  • "abstract" adds the text of the Wikipedia abstract;
  • "image" adds a link to an image depicting the tagged entity, as well as a link to the image thumbnail, served by Wikipedia. Please check the licensing terms of each image on Wikipedia before using it in your app;
  • "lod" adds links to equivalent (sameAs) entities in Linked Open Data repositories or other websites. It currently only supports DBpedia and Wikipedia;
  • "alternate_labels" adds some other names used when referring to the entity.
Type comma-separated list
Default value <empty string>
Accepted values types, categories, abstract, image, lod, alternate_labels
Example include=types,lod

Response

The response is structured in JSON as follow:

{
  "timestamp": "Date and time of the response generation process",
  "time": "Time elapsed for generating the response (milliseconds)",
  "count": "Total number of results",
  "query": "Type of query performed",
  "lang": "The language used to tag the input text",
  "entities": [
    {
      "weight": "Score for this match",
      "id": "ID of the linked Wikipedia resource",
      "title": "Title of the linked Wikipedia resource",
      "uri": "URL of the entity on Wikipedia",
      "label": "Most common name used to represent the resource",
      "types": ["List of types of the linked DBpedia resource","Only if 'include' parameter contains 'types'"],
      "categories": [
        "List of the category of the linked DBpedia resource",
        "Only if 'include' parameter contains 'categories'"
      ],
      "abstract": "Abstract of the linked Wikipedia resource. Only if 'include' parameter contains ­'abstract'",
      "lod": {
        "wikipedia": "URL of the Wikipedia article that represents the resource",
        "dbpedia": "URI of the resource on DBpedia"
      },
      "image": {
        "full": "URL of a depiction of the resource on Wikipedia. Only if 'include' parameter contains 'image'",
        "thumbnail": "URL of the thumbnail of the depiction. Only if 'include' parameter contains 'image'",
      }
    }
  ]
}

For more information about status codes and error handling please refer to the dandelion generic API documentations. The cost of each request can be found in the response headers as described here.

Example

Request

https://api.dandelion.eu/datagraph/wikisearch/v1/?text=Duomo%20di%20Trento&lang=it&limit=5&token=<YOUR_TOKEN>

Response

Connection: keep-alive
Content-Length: 755
Content-Type: application/json;charset=UTF-8
Date: Wed, 21 Oct 2015 16:29:37 GMT
Server: Apache-Coyote/1.1
X-DL-units: 1
X-DL-units-left: 999
X-DL-units-reset: 2015-10-22 00:00:00 +0000
{
  "time": 37,
  "count": 925,
  "query": "full",
  "entities": [
    {
      "weight": 30.046988,
      "id": 925191,
      "title": "Cattedrale di San Vigilio",
      "uri": "http://it.wikipedia.org/wiki/Cattedrale_di_San_Vigilio",
      "label": "Cattedrale di San Vigilio"
    },
    {
      "weight": 29.292465,
      "id": 730261,
      "title": "Duomo",
      "uri": "http://it.wikipedia.org/wiki/Duomo",
      "label": "Principale luogo di culto"
    },
    {
      "weight": 23.006647,
      "id": 100137,
      "title": "Trento",
      "uri": "http://it.wikipedia.org/wiki/Trento",
      "label": "Trento"
    },
    {
      "weight": 9.686819,
      "id": 20143,
      "title": "Duomo di Milano",
      "uri": "http://it.wikipedia.org/wiki/Duomo_di_Milano",
      "label": "Duomo di Milano"
    },
    {
      "weight": 9.361166,
      "id": 1280721,
      "title": "Lodron",
      "uri": "http://it.wikipedia.org/wiki/Lodron",
      "label": "Lodron"
    }
  ],
  "lang": "it",
  "timestamp": "2014-07-14T09:15:11.520"
}
SpazioDati Via A. Olivetti 13, 38122, Trento (TN) -


Dandelion API built with by

privacy | tos | cookies

Contact Us

@dandelionapi

Need more info or a custom project? Write us: hello@dandelion.eu

About Us

We're a startup based in Italy, specialized in Semantics & Big Data.
Find out more about us at spaziodati.eu