| | Version at: 16/06/2021, 00:41 vs. version at: 16/06/2021, 00:42 |
|---|
| 1 | # API |
|---|
| 2 | |
|---|
| 1 | 3 | Briefly, ... |
|---|
| 2 | 4 | |
|---|
| 3 | 5 | ## For one sentence |
|---|
| 4 | 6 | |
|---|
| 5 | 7 | https://tatoeba.org/eng/api_v0/sentence/1 |
|---|
| 6 | 8 | |
|---|
| 7 | 9 | ## Search results |
|---|
| 8 | 10 | |
|---|
| 9 | 11 | ### Search: Canadian (not an exact match, so gets "Canadians", too.) |
|---|
| 10 | 12 | from: eng |
|---|
| 11 | 13 | to: jpn |
|---|
| 12 | 14 | list: 907 |
|---|
| 13 | 15 | direct translations only |
|---|
| 14 | 16 | |
|---|
| 15 | 17 | https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=Canadian&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn |
|---|
| 16 | 18 | |
|---|
| 17 | 19 | ### Search: Boston |
|---|
| 18 | 20 | from: eng |
|---|
| 19 | 21 | to: jpn |
|---|
| 20 | 22 | audio: yes |
|---|
| 21 | 23 | sort: created |
|---|
| 22 | 24 | (direct and indirect translations) |
|---|
| 23 | 25 | |
|---|
| 24 | 26 | https://dev.tatoeba.org/eng/api_v0/search?from=eng&trans_filter=limit&query=Boston&sort=created&has_audio=yes&trans_to=jpn&to=jpn |
|---|
| 25 | 27 | |
|---|
| 26 | 28 | ### Search: =play (exact match) |
|---|
| 27 | 29 | from: eng |
|---|
| 28 | 30 | to: jpn |
|---|
| 29 | 31 | list: 907 |
|---|
| 30 | 32 | sort: words |
|---|
| 31 | 33 | direct translations only |
|---|
| 32 | 34 | |
|---|
| 33 | 35 | https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=%3Dplay&sort=created&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn |
|---|
| 34 | 36 | |
|---|
| 35 | 37 | ## Paging |
|---|
| 36 | 38 | |
|---|
| 37 | 39 | You can find out how many pages there thanks to the count and the perPage in the paging information. |
|---|
| 38 | 40 | |
|---|
| 39 | 41 | https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=Canadian&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn&page=2 |
|---|
| 40 | 42 | |
|---|
| 41 | 43 | "paging": { |
|---|
| 42 | 44 | "Sentences": { |
|---|
| 43 | 45 | "finder": "all", |
|---|
| 44 | 46 | "page": 2, |
|---|
| 45 | 47 | "current": 8, |
|---|
| 46 | 48 | "count": 18, |
|---|
| 47 | 49 | "perPage": 10, |
|---|
| 48 | 50 | "start": 11, |
|---|
| 49 | 51 | "end": 18, |
|---|
| 50 | 52 | "prevPage": true, |
|---|
| 51 | 53 | "nextPage": false, |
|---|
| 52 | 54 | "pageCount": 2, |
|---|
| 53 | 55 | "sort": null, |
|---|
| 54 | 56 | "direction": null, |
|---|
| 55 | 57 | "limit": null, |
|---|
| 56 | 58 | "sortDefault": false, |
|---|
| 57 | 59 | "directionDefault": false, |
|---|
| 58 | 60 | "scope": null, |
|---|
| 59 | 61 | "completeSort": [] |
|---|
| 60 | 62 | } |
|---|
| 61 | 63 | }, |
|---|
| 62 | 64 | |
|---|
| 63 | 65 | |
|---|
| 64 | 66 | |
|---|
| 65 | 67 | The properties you'll be interested in are: |
|---|
| 66 | 68 | |
|---|
| 67 | 69 | page - this is the current page. |
|---|
| 68 | 70 | current - this is the number of items displayed in the current page. |
|---|
| 69 | 71 | count - this is the total number of results. |
|---|
| 70 | 72 | perPage - this is the number of results per page. |
|---|
| 71 | 73 | To know how many pages there are in total, you divide count by perPage and round up to the upper integer. |
|---|
| 72 | 74 | |
|---|
| 73 | 75 | |
|---|
| 74 | 76 | |
|---|
| 75 | 77 | |
|---|
| 76 | 78 | ## For information on the API, ... |
|---|
| 77 | 79 | |
|---|
| 78 | 80 | See https://github.com/Tatoeba/tatoeba2/issues/2669 |
|---|
| 79 | 81 | |
|---|
| 80 | 82 | |
|---|
| 81 | 83 | |
|---|
| diff view generated by jsdifflib |
|---|
Version at: 16/06/2021, 00:41
Briefly, ...
## For one sentence
https://tatoeba.org/eng/api_v0/sentence/1
## Search results
### Search: Canadian (not an exact match, so gets "Canadians", too.)
from: eng
to: jpn
list: 907
direct translations only
https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=Canadian&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn
### Search: Boston
from: eng
to: jpn
audio: yes
sort: created
(direct and indirect translations)
https://dev.tatoeba.org/eng/api_v0/search?from=eng&trans_filter=limit&query=Boston&sort=created&has_audio=yes&trans_to=jpn&to=jpn
### Search: =play (exact match)
from: eng
to: jpn
list: 907
sort: words
direct translations only
https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=%3Dplay&sort=created&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn
## Paging
You can find out how many pages there thanks to the count and the perPage in the paging information.
https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=Canadian&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn&page=2
"paging": {
"Sentences": {
"finder": "all",
"page": 2,
"current": 8,
"count": 18,
"perPage": 10,
"start": 11,
"end": 18,
"prevPage": true,
"nextPage": false,
"pageCount": 2,
"sort": null,
"direction": null,
"limit": null,
"sortDefault": false,
"directionDefault": false,
"scope": null,
"completeSort": []
}
},
The properties you'll be interested in are:
page - this is the current page.
current - this is the number of items displayed in the current page.
count - this is the total number of results.
perPage - this is the number of results per page.
To know how many pages there are in total, you divide count by perPage and round up to the upper integer.
## For information on the API, ...
See https://github.com/Tatoeba/tatoeba2/issues/2669
version at: 16/06/2021, 00:42
# API
Briefly, ...
## For one sentence
https://tatoeba.org/eng/api_v0/sentence/1
## Search results
### Search: Canadian (not an exact match, so gets "Canadians", too.)
from: eng
to: jpn
list: 907
direct translations only
https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=Canadian&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn
### Search: Boston
from: eng
to: jpn
audio: yes
sort: created
(direct and indirect translations)
https://dev.tatoeba.org/eng/api_v0/search?from=eng&trans_filter=limit&query=Boston&sort=created&has_audio=yes&trans_to=jpn&to=jpn
### Search: =play (exact match)
from: eng
to: jpn
list: 907
sort: words
direct translations only
https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=%3Dplay&sort=created&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn
## Paging
You can find out how many pages there thanks to the count and the perPage in the paging information.
https://dev.tatoeba.org/eng/api_v0/search?from=eng&list=907&query=Canadian&trans_filter=limit&trans_link=direct&trans_to=jpn&to=jpn&page=2
"paging": {
"Sentences": {
"finder": "all",
"page": 2,
"current": 8,
"count": 18,
"perPage": 10,
"start": 11,
"end": 18,
"prevPage": true,
"nextPage": false,
"pageCount": 2,
"sort": null,
"direction": null,
"limit": null,
"sortDefault": false,
"directionDefault": false,
"scope": null,
"completeSort": []
}
},
The properties you'll be interested in are:
page - this is the current page.
current - this is the number of items displayed in the current page.
count - this is the total number of results.
perPage - this is the number of results per page.
To know how many pages there are in total, you divide count by perPage and round up to the upper integer.
## For information on the API, ...
See https://github.com/Tatoeba/tatoeba2/issues/2669