|
1 | 1 | # Random Sentence API |
2 | 2 |
|
3 | | -## based on |
| 3 | +## 🗂️ Data Source |
4 | 4 |
|
5 | 5 | - traditional korean proverbs, more than 4,000 |
| 6 | + - from https://www.krpia.co.kr/product/main?plctId=PLCT00004626#none |
6 | 7 | - famous saying (soon) |
7 | 8 | - maxim (soon) |
8 | 9 |
|
9 | 10 | --- |
10 | 11 |
|
11 | | -## direction |
| 12 | +## 📚 Specification |
12 | 13 |
|
13 | | -### api url |
| 14 | +(No author information is provided for traditional Korean proverbs.) |
14 | 15 |
|
15 | | -💡`https://sentence.udtk.site/random/{count}` |
| 16 | +### 1. `https://sentence.udtk.site/{id}` |
16 | 17 |
|
17 | | -- count : number of sentences to get |
18 | | -- count range : 1 ~ 20 |
| 18 | +- **description** : return a sentence by id |
| 19 | + |
| 20 | +### 2. `https://sentence.udtk.site/random?count=` |
| 21 | + |
| 22 | +- **description** : return several random sentences |
| 23 | +- request parameter : `count` |
| 24 | + - count : number of sentences to get |
| 25 | + - range : 1 ~ 20 |
| 26 | + - default : 1 |
| 27 | + |
| 28 | +### 3. `https://sentence.udtk.site/language?language=&count=` |
| 29 | + |
| 30 | +- **description** : return random sentences in chosen language |
| 31 | +- request parameter : language, count |
| 32 | + - language : `kor`, `eng` |
| 33 | + - default : `kor` |
| 34 | + - count : number of sentences to get |
| 35 | + - range : 1 ~ 20 |
| 36 | + - default : 1 |
| 37 | + |
| 38 | +### 4. `https://sentence.udtk.site/sort?sort=&count=` |
| 39 | + |
| 40 | +- **description** : return random sentences in chosen sort |
| 41 | +- request parameter : `sort`, `count` |
| 42 | + - sort : `가1`, `가2`, `나`, `다`, `마`, `바`, `사1`, `사2`, `아1`, `아2`, `자1`, `자2`, `차`, `카`, `타`, `파`, `하`, `quote` |
| 43 | + - default : `가1` |
| 44 | + - count : number of sentences to get |
| 45 | + - range : 1 ~ 20 |
| 46 | + - default : 1 |
| 47 | + |
| 48 | +--- |
19 | 49 |
|
20 | 50 | ### response example |
21 | 51 |
|
22 | | -`https://sentence.udtk.site/random/2` |
| 52 | +ex) https://sentence.udtk.site/random?count=2 |
23 | 53 |
|
24 | 54 | ```json |
25 | 55 | [ |
|
34 | 64 | ] |
35 | 65 | ``` |
36 | 66 |
|
37 | | -### request limit |
| 67 | +### ❗️request limit |
38 | 68 |
|
39 | | -- 20 requests per 5 minutes |
40 | | -- when the limit is exceeded, the response will be `429 Too Many Requests` |
41 | | - - time left to reset the limit will be included in the response header `X-Rate-Limit-Retry-After-Seconds` |
| 69 | +- **<U>20 requests per 5 minutes</U>** |
| 70 | +- when the limit is exceeded, the response will be 429 Too Many Requests |
| 71 | +- time left to reset the limit will be included in the response header X-Rate-Limit-Retry-After-Seconds |
42 | 72 |
|
43 | 73 | --- |
44 | 74 |
|
45 | | -## stack |
| 75 | +## 🛠️ Stack |
46 | 76 |
|
47 | 77 | - Java 17 |
48 | 78 | - Spring Boot 3.3.3 |
|
57 | 87 |
|
58 | 88 | --- |
59 | 89 |
|
60 | | -## architecture |
| 90 | +## 🏗️ Architecture |
61 | 91 |
|
62 | | -<img src="./assets/sentence-architecture.jpg" alt="architecture"> |
| 92 | +<img src="./assets/sentence-architecture.jpg" alt="architecture" width=600> |
0 commit comments