Linguatools top spanish collocation API

Overview
Looks up a word in a spanish collocation database with the top spanish collocations and returns
- the best spanish collocations ordered by frequency
- 2 or 3 example sentences for each collocation
How to use Linguatools Top Spanish Collocation API
Connect to API
GET /?lang={lang}&query={word}
parameter | description | parameter value |
lang | The following language ISO 639-1 code (case sensitive) | es (more in preparation) |
query | any word (case insensitive) | e.g. prestar, dar, apoyo, llevar |
Test the API
You can test the API and develop your own application with our test translate API – for free.
Test the test API with:
- lang
es
- query
prestar
http request (test API)
https://lt-collocation-es-test.herokuapp.com/?lang=es&query=prestar
wget https://lt-collocation-es-test.herokuapp.com/?lang=es&query=prestar
Important note (!):
The initial API call might take up to 30 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 the 200 most frequently used spanish collocations are included in the test API. The paid API (see below) contains the best 2,000 manually selected spanish collocations with 2-3 example sentences.
API response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
[ { id: 13, collocation: "prestar asistencia", freq: 28287, example1: "Además, la policía griega también les presta asistencia.", example2: "Otras organizaciones de beneficencia kuwaitíes también siguen prestando asistencia.", example3: "El CIIGB, como institución, también debe prestar asistencia." } , { id: 24, collocation: "prestar apoyo", freq: 25277, example1: "Las organizaciones locales o regionales interesadas les prestarían apoyo.", example2: "Se tratará de un mecanismo adecuado para prestar apoyo.", example3: "Durante la campaña, los Tigres Voladores prestaron apoyo aéreo." } , { id: 33, collocation: "prestar servicio", freq: 20075, example1: "El equipo de expertos presta servicios de psiquiatría infantil.", example2: "Las ONG y las iglesias también prestan servicios similares.", example3: "El equipo aún tardará unos meses en empezar a prestar servicio." } , { id: 17, collocation: "prestar atención", freq: 9459, example1: "Durante un rato vamos más despacio, prestamos atención.", example2: "El hombre no chista, ni siquiera presta atención.", example3: "Hay muchas cuestiones a las cuales debemos prestar atención." } ] |
Code snippets
Ruby
1 2 3 4 5 6 |
require 'curb' require 'json' apiurl = "https://lt-collocation-es-test.herokuapp.com/?lang=es&query=prestar" api = Curl::Easy.new(apiurl) api.perform json_data = JSON.parse(api.body_str) |
Python
1 2 3 4 5 |
import requests import json apiurl = 'https://lt-collocation-es-test.herokuapp.com/?lang=es&query=prestar' response = requests.get(apiurl) json_data = json.loads(response.text) |
Paid API
Content
The paid API includes 2,000 spanish collocations with 2-3 spanish example sentences.
The parameters are the same as in the test API.
After licensing you get the end point to access the full collocation database with the 2,000 most frequently used spanish collocations .
Examples of use
You can query the manually compiled 2.000 most frequently used Spanish collocations in this online demo.
For each collocation example sentences are provided.
Licensing conditions
Top Spanish collocations as a data package
The 2,000 manually selected spanish collocations are also available as a data package.
Other language APIs by linguatools: https://linguatools.org/language-apis/
An overview of all collocation databases: https://linguatools.org/online-projects/collocation-database/