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