Migration guide from API v0 to API v1
Base host
Get a sentence
On API v1, associated data (translations, audios and transcriptions) is not returned by default.
| API v0 | API v1 | |
|---|---|---|
| Base call | /en/api_v0/sentence/1 |
/v1/sentences/1 |
| Get translations, too | /en/api_v0/sentence/1 |
/v1/sentences/1?showtrans=all |
| Get audios, too | /en/api_v0/sentence/1 |
/v1/sentences/1?include=audios |
| Get transcriptions, too. | /en/api_v0/sentence/1 |
/v1/sentences/1 |
| Get all the above, too. | /en/api_v0/sentence/1 |
/v1/sentences/1 |
Search sentences
On API v1, audios and transcriptions are not returned by default, you need to use include=audios,transcriptions to get them.
As for translations, by default only translations matched by non-excluding filters are returned. In other words, by default you only get translations if you use a "only return sentences having translations like this" kind of filter, and you only get the translations matched by that filter. Use showtrans=all to get all translations. Alternatively, use a filter such as showtrans:lang=eng to get some of the translations.
| API v0 | API v1 | |
|---|---|---|
| Endpoint | /en/api_v0/search |
/v1/sentences |
| Sentence in English | from=eng |
lang=eng |
| Sentence in any language |
from=und |
N/A |
| Keywords | query=example |
q=example |
| Has at least 10 words |
word_count_min=10
|
word_count=10- |
| Has at most 10 words |
word_count_max=10
|
word_count=-10 |
| Has between 6 and 10 words |
word_count_min=6 |
word_count=6-10 |
| Sentence is owned by gillux |
user=gillux |
owner=gillux |
| Sentence is orphan | orphans=yes |
is_orphan=yes |
| Sentence is unapproved |
unapproved=yes |
is_unapproved=yes |
| Sentence is owned by a native speaker |
native=yes |
is_native=yes |
| Sentence has audio | has_audio=yes |
has_audio=yes |
| Sentence is tagged as proverb |
tags=proverb |
tag=proverb |
| Sentence is original | original=yes |
origin=original |
| Sentence is on list 1234 |
list=1234 |
list=1234 |
| Only having Spanish translations |
trans_to=spa&to=spa |
trans:lang=spa |
| Show all translations | to=und |
showtrans=all |
| Show no translation | to=none |
showtrans=none |
| Having Spanish translations, showing Japanese ones |
trans_to=spa&to=jpn |
trans:lang=spa |
| Having direct translations |
trans_filter=limit |
trans:is_direct=yes |
| Having translations owned by gillux |
trans_filter=limit |
trans:owner=gillux |
| Having orphan translations |
trans_filter=limit |
trans:is_orphan=yes |
| Having unapproved translations |
trans_filter=limit |
trans:is_unapproved=yes |
| Having translations owned by a native speaker |
trans_filter=limit |
trans:is_native=yes |
| Having translations with audio |
trans_filter=limit |
trans:has_audio=yes |
| Exclude sentences having Spanish translations |
trans_filter=exclude |
!trans:lang=spa |
| Exclude sentences having translations owned by gillux |
trans_filter=limit |
!trans:owner=gillux |
| Sort by words, few to many |
sort=words |
sort=words |
| Sort by words, many to few |
sort=words |
sort=-words |
| Pagination | Append page=n |
Follow returned paging links |