Linguatools Collocation API

Overview

Looks up a word in a dictionary and returns

  • all collocations ordered by significance with
  • up to 3 example sentences
  • relation

How to use Linguatools Collocation API

Connect to API

Endpoint and Parameters

Endpoint:
GET /?lang={lang}&query={word}&min_sig={significance}&relation={relation}

parameter description parameter value
query any word (Case insensitive) ex. change
lang One of the following language short codes (Case sensitive): en (more in progres)
relation One of the following relations (Case sensitive, optional): V:obj:N
N:prep:N
V:subj:N
N:nn:N
N:mod:A
V:obj+prep:N
V:prep:N
V:sc:V
V:mod:A
A:mod:A
V:obj1+2:N

min_sig any number as the minimum significance (Optional) 1,2,3333,75334, etc.

Test the API

You can test the API and develop your own application with out test translate API – for free.

Test the test API with:

  • lang: en
  • query: smoke
  • relation: V:obj:N (optional)

http request

https://lt-collocation-test.herokuapp.com/todos/?query=smoke&lang=en&relation=V:obj:N
wget https://lt-collocation-test.herokuapp.com/todos/?query=smoke&lang=en&relation=V:obj:N

Important note (!):
The initial API call might take up to 15 seconds because the heroku dyno falls asleep after 30 minutes of inactivity. (The TEST-API runs on a free heroku dyno.)

Further limits of the test API:
The test API contains only a subset of the complete collocation database. Only high significant collocations (significance > 30000) are included. Therefore only 6 thousand collocations are included in the test API. The paid API (see below) contains more than 4 millions collocations.

API response

In raw format you will see the html tags <b> and </b> as \u003cb\u003e and \u003c/b\u003e

Code snippets

Ruby

Python

Examples of use

1. Query the complete linguatools collocations database online:
URL: http://www.linguatools.de/kollokationen-en/
2. We make use of collocations in our online tool Gramomat:
URL: https://gramomat.com/ [A click into the object field to see the suggested collocations]

If you want to use the collocation API with 4 millions collocations in your project please contact peter.kolb@linguatools.org for pricing and licence conditions.
Other language APIs by linguatools: https://linguatools.org/language-apis/