Walle1029(通过微信账号登录)
1538754699@qq.com1.1. 获取所有生词本
1.2. 添加一个新的生词本
1.3. 重命名一个生词本
1.4. 删除一个生词本
1.5. 获取生词本中的单词
1.6. 添加单词到生词本
1.7. 删除生词本中的单词
1.8. 新增生词本中的一个单词
1.9. 查询生词本中的一个单词
1.10. 查询已掌握单词
1.11. 查询用户词汇列表
1.12. 批量查询用户词汇单词详情
1.13. 获取例句列表
1.14. 解析文章生成词汇提示
接口说明:
GEThttps://api.frdic.com/api/open/v1/studylist/category协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | GET |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| language | string | query | 语言 | True | en/fr/de/es |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | Array | 生词本信息 | 请求成功时存在 |
| message | text | 提示信息 |
*data 生词本信息:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| id | text | 生词本ID | |
| language | text | 语言 | |
| name | text | 生词本名称 |
示例:
Requset Method: GET
Request URL:https://api.frdic.com/api/open/v1/studylist/category?language=en
Response Code:200
Response Body:
{
"data": [
{
"id": "0",
"language": "en",
"name": "我的生词本"
},
{
"id": "132303016416635230",
"language": "en",
"name": "nanana3"
},
{
"id": "132303016647118400",
"language": "en",
"name": "新的名称"
}
],
"message": ""
}
生成接口请求代码(python-request):
import requests
url = "https://api.frdic.com/api/open/v1/studylist/category?language=en"
headers = {
'User-Agent': 'Mozilla/5.0',
'Authorization': 'NIS xxxx'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
接口说明:
POSThttps://api.frdic.com/api/open/v1/studylist/category协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | POST |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| value | object | body | 生词本信息 | True | Content-Type: application/json |
*value 生词本信息:
| 字段名 | 数据类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|
| language | text | 语言 | True | en/fr/de/es |
| name | text | 课本名称 | True |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | object | 新的生词本信息 | 请求成功时存在 |
| message | text | 提示信息 |
*data 生词本信息:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| id | text | 生词本ID | |
| language | text | 语言 | |
| name | text | 生词本名称 |
示例:
Requset Method: POST
Request URL:https://api.frdic.com/api/open/v1/studylist/category
Request Body:
{
"language": "en",
"name": "新增生词本1"
}
Response Code:201
Response Body:
{
"data": {
"id": "132314173819830130",
"language": "en",
"name": "新增生词本1"
},
"message": ""
}
生成接口请求代码(python-request):
import requests
import json
url = "https://api.frdic.com/api/open/v1/studylist/category"
payload = json.dumps({
"language": "en",
"name": "test"
})
headers = {
'User-Agent': 'Mozilla/5.0',
'Authorization': 'NIS xxxx',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
接口说明:
PATCHhttps://api.frdic.com/api/open/v1/studylist/category协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | PATCH |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| value | object | body | 生词本信息 | True | Content-Type: application/json |
*value 生词本信息:
| 字段名 | 数据类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|
| id | text | 生词本ID | True | |
| language | text | 语言 | True | en/fr/de/es |
| name | text | 课本名称 | True |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| message | text | 提示信息 |
示例:
Requset Method: PATCH
Request URL:https://api.frdic.com/api/open/v1/studylist/category
Request Body:
{
"id": "132314173819830125",
"language": "en",
"name": "新的名称1"
}
Response Code:201
Response Body:
{
"message": "分类重命名成功"
}
生成接口请求代码(python-request):
import requests
import json
url = "https://api.frdic.com/api/open/v1/studylist/category"
payload = json.dumps({
"id": "132571528645227886",
"language": "en",
"name": "test1"
})
headers = {
'User-Agent': 'Mozilla/5.0',
'Authorization': 'NIS xxxx',
'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
接口说明:
DELETEhttps://api.frdic.com/api/open/v1/studylist/category协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | DELETE |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| value | object | body | 生词本信息 | True | Content-Type: application/json |
*value 生词本信息:
| 字段名 | 数据类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|
| id | text | 生词本ID | True | |
| language | text | 语言 | True | en/fr/de/es |
| name | text | 课本名称 | True |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| message | text | 提示信息 | 失败时存在 |
示例:
Requset Method: DELETE
Request URL:https://api.frdic.com/api/open/v1/studylist/category
Request Body:
{
"id": "132314173819830125",
"language": "en",
"name": "新的名称1"
}
Response Code:204
生成接口请求代码(python-request):
import requests
import json
url = "https://api.frdic.com/api/open/v1/studylist/category"
payload = json.dumps({
"id": "{{test_openapi_category}}",
"language": "en",
"name": "test1"
})
headers = {
'User-Agent': 'Mozilla/5.0',
'Authorization': 'NIS xxxx',
'Content-Type': 'application/json'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
接口说明:
GEThttps://api.frdic.com/api/open/v1/studylist/words协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | GET |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| category_id | text | query | 生词本ID | True | |
| language | text | query | 语言 | True | en/fr/de/es |
| page | integer | query | 分页页数 | False | 从 0 开始,最小 0,最大 50 |
| page_size | integer | query | 分页单词数量 | False | 默认 100,最大 100 |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | Array | 单词信息 | 请求成功时存在 |
| message | text | 提示信息 |
*data 单词信息:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| word | string | 单词 | |
| phon | string | 音标 | |
| exp | string | 释义 | |
| add_time | string | 时间 | |
| star | int | 单词等级 | |
| context_line | string | 单词所在语境 |
示例:
Requset Method: GET
Request URL:https://api.frdic.com/api/open/v1/studylist/words?language=en&category_id=0&page=0&page_size=2
Response Code:200
Response Body:
{
"data": [
{
"word": "action",
"phon": "/'ækʃn/",
"exp": "n. 行动;活动;功能;情节;战斗",
"add_time": "2020-10-29T18:23:29Z",
"star": 1,
"context_line": "He took immediate action to solve the problem when he noticed it.",
},
{
"word": "and",
"phon": "/ənd/",
"exp": "conj. 和,与;而且;然后;就;但是",
"add_time": "2020-10-29T18:23:29Z",
"star": 1,
}
],
"message": ""
}
接口说明:
POSThttps://api.frdic.com/api/open/v1/studylist/words协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | POST |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| value | object | body | 生词本信息 | True | Content-Type: application/json |
*value 生词本信息:
| 字段名 | 数据类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|
| id | text | 生词本ID | True | 已废弃,建议使用category_id |
| category_id | text | 生词本ID | True | |
| language | text | 语言 | True | en/fr/de/es |
| words | Array[text] | 单词数组 | True |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| message | text | 提示信息 |
示例:
Requset Method: POST
Request URL:https://api.frdic.com/api/open/v1/studylist/words
Request Body:
{
"language": "en",
"category_id":"0",
"words": [
"english",
"french"
]
}
Response Code:201
Response Body:
{
"message": "单词导入成功,导入数量 : 2"
}
接口说明:
DELETEhttps://api.frdic.com/api/open/v1/studylist/words协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | DELETE |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| value | object | body | 生词本信息 | True | Content-Type: application/json |
*value 生词本信息:
| 字段名 | 数据类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|
| id | text | 生词本ID | True | 已废弃,建议使用category_id |
| category_id | text | 生词本ID | True | |
| language | text | 语言 | True | en/fr/de/es |
| words | Array[text] | 单词数组 | True |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| message | text | 提示信息 | 失败时存在 |
示例:
Requset Method: DELETE
Request URL:https://api.frdic.com/api/open/v1/studylist/words
Request Body:
{
"language": "en",
"category_id": 0,
"words": [
"english",
"french"
]
}
Response Code:204
接口说明:
POSThttps://api.frdic.com/api/open/v1/studylist/word协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | POST |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| value | object | body | 生词信息 | True | Content-Type: application/json |
*value 生词本信息:
| 字段名 | 数据类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|
| language | text | 语言 | True | en/fr/de/es |
| word | text | 单词 | True | |
| star | text | 等级 | False | |
| context_line | text | 语境 | False | |
| category_ids | text | 分组列表 | False | 不设置则加到默认分组 |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| message | text | 提示信息 |
示例:
Requset Method: POST
Request URL:https://api.frdic.com/api/open/v1/studylist/word
Request Body:
{
"language": "en",
"word": "hello",
"star": 2,
"context_line": "hello, how are you?",
"category_ids": [0]
}
Response Code:201
Response Body:
{
"message": "单词添加成功"
}
生成接口请求代码(python-request):
import http.client
import json
conn = http.client.HTTPSConnection("api.frdic.com")
payload = json.dumps({
"language": "en",
"word": "hello",
"star": 2,
"context_line": "hello, how are you?",
"category_ids": [0]
})
headers = {
'User-Agent': 'Mozilla/5.0',
'Authorization': 'NIS xxxx',
'Content-Type': 'application/json'
}
conn.request("POST", "/api/open/v1/studylist/word/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
接口说明:
GEThttps://api.frdic.com/api/open/v1/studylist/word协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | GET |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| language | text | query | 语言 | True | en/fr/de/es |
| word | text | 单词 | True |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | Array | 单词信息 | 请求成功时存在 |
*data 单词信息:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| word | string | 单词 | |
| exp | string | 释义 | |
| add_time | string | 时间 | |
| star | int | 单词等级 | |
| context_line | string | 单词所在语境 | |
| category_ids | string | 单词所在分组 |
示例:
Requset Method: GET
Request URL:https://api.frdic.com/api/open/v1/studylist/word?language=en&word=hello
Response Code:200
Response Body:
{
"word": "hello",
"exp": "",
"add_time": "2025-06-02T21:09:39Z",
"star": 2,
"context_line": "<b>hello</b>, how are you?",
"category_ids": [0]
}
生成接口请求代码(python-request):
import http.client
conn = http.client.HTTPSConnection("api.frdic.com")
payload = ''
headers = {
'User-Agent': 'Mozilla/5.0',
'Authorization': 'NIS xxxx',
'Content-Type': 'application/json'
}
conn.request("GET", "/api/open/v1/studylist/word?language=en&word=hello", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
接口说明:
GEThttps://api.frdic.com/api/open/v1/studylist/mastered_wordsUserMemoryItem / eudic_cus_memory 中存在该单词为准协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | GET |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| language | text | query | 语言 | True | en/fr/de/es |
| category_id | text | query | 生词本ID | False | 仅返回该分组与已掌握列表的交集 |
| page | integer | query | 分页页数 | False | 从 0 开始,最小 0,最大 50 |
| page_size | integer | query | 分页单词数量 | False | 默认 100,最大 100 |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | Array | 单词信息 | 请求成功时存在 |
| message | text | 提示信息 |
*data 单词信息:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| word | string | 单词 | |
| add_time | string | 时间 |
示例:
Requset Method: GET
Request URL:https://api.frdic.com/api/open/v1/studylist/mastered_words?language=en&page=0&page_size=2
Response Code:200
Response Body:
{
"data": [
{
"word": "pool",
"add_time": "2020-01-23T21:12:56Z"
},
{
"word": "amplify",
"add_time": "2020-06-15T21:18:11Z"
}
],
"message": ""
}
生成接口请求代码(python-request):
import http.client
conn = http.client.HTTPSConnection("api.frdic.com")
payload = ''
headers = {
'User-Agent': 'Mozilla/5.0',
'Authorization': 'NIS xxxx',
'Content-Type': 'application/json'
}
conn.request("GET", "/api/open/v1/studylist/mastered_words?language=en&page=0&page_size=2", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
接口说明:
GEThttps://api.frdic.com/api/open/v1/studylist/vocab_entriesstudy_list.rating > 0)筛选。协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | GET |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| language | string | query | 语言 | True | en/fr/de/es |
| recent_days | integer | query | 最近 N 天 | False | <= 0 表示不筛选 |
| is_favorited | bool | query | 是否已收藏到生词本 | False | true 只看已收藏,false 只看未收藏 |
| page | integer | query | 页码 | False | 从 0 开始,最小 0,最大 50 |
| page_size | integer | query | 每页数量 | False | 默认 100,最大 100 |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | Array | 语料列表 | 成功时返回 |
| message | text | 提示信息 |
data 字段说明:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| word | string | 单词 | |
| exp | string | 释义 | |
| add_time | string | 添加时间 | |
| rating | int | 生词本评级 | > 0 表示已收藏 |
| contexts | Array | 语境列表 | 可能为空 |
contexts 字段说明:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| src | string | 原文语境 | |
| trans | string | 译文语境 | |
| word_in_context | string | 语境中的词形 |
调用示例:
请求方式:GET
请求地址:https://api.frdic.com/api/open/v1/studylist/vocab_entries?language=en&recent_days=30&is_favorited=true&page=0&page_size=2
响应状态码:200
响应内容:
{
"data": [
{
"word": "action",
"exp": "n. action; activity; function; plot; combat",
"add_time": "2025-03-01T08:30:00Z",
"rating": 2,
"contexts": [
{
"src": "He took immediate action to solve the problem.",
"trans": "He solved it right away.",
"word_in_context": "action"
}
]
},
{
"word": "amplify",
"exp": "vt. amplify; enhance",
"add_time": "2025-02-18T09:15:00Z",
"rating": 1,
"contexts": []
}
],
"message": ""
}
Python示例:
import http.client
conn = http.client.HTTPSConnection("api.frdic.com")
payload = ""
headers = {
"User-Agent": "Mozilla/5.0",
"Authorization": "NIS xxxx",
"Content-Type": "application/json"
}
conn.request("GET", "/api/open/v1/studylist/vocab_entries?language=en&recent_days=30&is_favorited=true&page=0&page_size=2", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
接口说明:
POSThttps://api.frdic.com/api/open/v1/studylist/vocab_words协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | POST |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| value | object | body | 请求体 | True | Content-Type: application/json |
value 字段说明:
| 字段名 | 类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|
| language | text | 语言 | True | en/fr/de/es |
| words | Array[text] | 要查询的单词列表 | True | 空白单词会被忽略,重复项会去重 |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | Array | 单词详情列表 | 成功时返回 |
| message | text | 提示信息 |
data 字段说明:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| word | string | 单词 | |
| exp | string | 释义 | |
| contexts | Array | 语境列表 | 可能为空 |
contexts 字段说明:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| src | string | 原文语境 | |
| trans | string | 译文语境 | |
| word_in_context | string | 语境中的词形 |
调用示例:
请求方式:POST
请求地址:https://api.frdic.com/api/open/v1/studylist/vocab_words
请求内容:
{
"language": "en",
"words": [
"action",
"amplify"
]
}
响应状态码:200
响应内容:
{
"data": [
{
"word": "action",
"exp": "n. action; activity; function; plot; combat",
"contexts": [
{
"src": "He took immediate action to solve the problem.",
"trans": "He solved it right away.",
"word_in_context": "action"
}
]
},
{
"word": "amplify",
"exp": "vt. amplify; enhance",
"contexts": []
}
],
"message": ""
}
Python示例:
import requests
import json
url = "https://api.frdic.com/api/open/v1/studylist/vocab_words"
payload = json.dumps({
"language": "en",
"words": ["action", "amplify"]
})
headers = {
"User-Agent": "Mozilla/5.0",
"Authorization": "NIS xxxx",
"Content-Type": "application/json"
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
接口说明:
GEThttps://api.frdic.com/api/open/v1/studylist/sentences协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | GET |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| language | string | query | 语言 | True | en/fr/de/es |
| page | integer | query | 页码 | False | 从 0 开始,最大 50;小于 0 按 0 处理 |
| page_size | integer | query | 每页数量 | False | 默认 100,最大 100 |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | Array | 例句列表 | 成功时返回 |
| message | text | 提示信息 |
data 字段说明:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| sentence | string | 例句原文 | |
| translation | string | 例句翻译 | |
| note | string | 笔记 | |
| add_time | string | 添加时间 |
调用示例:
请求方式:GET
请求地址:https://api.frdic.com/api/open/v1/studylist/sentences?language=en&page=0&page_size=2
响应状态码:200
响应内容:
{
"data": [
{
"sentence": "He took immediate action to solve the problem.",
"translation": "他立即采取行动解决了这个问题。",
"note": "",
"add_time": "2025-03-01T08:30:00Z"
},
{
"sentence": "The music was amplified by the speakers.",
"translation": "音乐被扬声器放大了。",
"note": "物理语境",
"add_time": "2025-02-18T09:15:00Z"
}
],
"message": ""
}
Python示例:
import http.client
conn = http.client.HTTPSConnection("api.frdic.com")
payload = ""
headers = {
"User-Agent": "Mozilla/5.0",
"Authorization": "NIS xxxx",
"Content-Type": "application/json"
}
conn.request("GET", "/api/open/v1/studylist/sentences?language=en&page=0&page_size=2", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
接口说明:
POSThttps://api.frdic.com/api/open/v1/studylist/vocab_hints?language=en429。协议须知:
| 规则 | 描述 |
|---|---|
| 传输方式 | HTTPS |
| 请求方式 | POST |
| 字符编码 | UTF-8 |
| 响应格式 | JSON |
接口调用参数:
| 字段名 | 数据类型 | 参数类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|---|
| language | string | query | 语言 | True | en/fr/de/es |
| value | object | body | 文章解析请求 | True | Content-Type: application/json |
*value 字段说明:
| 字段名 | 类型 | 含义 | 必填 | 备注 |
|---|---|---|---|---|
| text | string | 待解析文章文本 | True | 支持 URL 编码文本 |
| word_tags | Array[text] | 单词标签 | False | 可选值:gk、cet4、cet6、yjs、cet8、ielts、toefl;空则不生成单词 |
| phrase_tags | Array[text] | 词组标签 | False | 可选值:phrasal、idiom、collocation;空则不生成词组 |
| customize | bool | 是否匹配用户生词本 | False | true 时返回文章中命中的用户生词 |
| include_mastered | bool | 是否包含已掌握单词 | False | false 时过滤已掌握单词 |
输出结果:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| data | object | 语料同步数据 | 成功时返回 |
| message | text | 提示信息 |
*data 字段说明:
| 字段名 | 类型 | 含义 | 备注 |
|---|---|---|---|
| vocab_items | Array | 语料单词/词组列表 | |
| vocab_sources | Array | 语料来源上下文列表 |
调用示例:
请求方式:POST
请求地址:https://api.frdic.com/api/open/v1/studylist/vocab_hints?language=en
请求内容:
{
"text": "Negotiation is a subtle art that requires patience and empathy. A skilled negotiator must take into account the other party's underlying concerns before reaching a consensus. In many cases, the willingness to compromise paves the way for a mutually beneficial outcome. He decided to break the ice with a light-hearted remark, which helped both sides let their guard down.",
"word_tags": [
"cet4",
"cet6",
"ielts",
"toefl"
],
"phrase_tags": [
"phrasal",
"idiom",
"collocation"
],
"customize": true,
"include_mastered": true
}
响应状态码:200
响应内容:
{
"data": {
"vocab_items": [
{
"word": "a must",
"type": 1,
"tags": "idiom",
"exp": "必要条件;必不可少的事物"
}
],
"vocab_sources": [
{
"sync_id": "a must2jmj7l5rSw0yVb/vlWAYkK/YBwk=",
"word": "a must",
"word_in_context": "A skilled negotiator must",
"source_context": "{\"context\":[{\"src\":\"<b>A skilled negotiator must</b> take into account the other party's underlying concerns before reaching a consensus.\"}]}"
}
]
},
"message": ""
}
Python示例:
import requests
import json
url = "https://api.frdic.com/api/open/v1/studylist/vocab_hints?language=en"
payload = json.dumps({
"text": "Negotiation is a subtle art that requires patience and empathy. A skilled negotiator must take into account the other party's underlying concerns before reaching a consensus. In many cases, the willingness to compromise paves the way for a mutually beneficial outcome. He decided to break the ice with a light-hearted remark, which helped both sides let their guard down.",
"word_tags": ["cet4", "cet6", "ielts", "toefl"],
"phrase_tags": ["phrasal", "idiom", "collocation"],
"customize": True,
"include_mastered": True
})
headers = {
"User-Agent": "Mozilla/5.0",
"Authorization": "NIS xxxx",
"Content-Type": "application/json"
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)