近反义词查询API接口

本站现已经收录上万余条近、反、同义词,支持词语拼音首字母,全拼音,完整词或用空格分隔等多方式综合查询(默认精确查询)。

接口文档 《查看会员》
接口地址: http://api.toolfk.com/api/fanyi-detail | 在线体验接口
请求方法: [ "GET", "POST" ]
请求参数:
名称类型描述示例
tokenstring请求的token用户中心获取token
titlestring 查询标题 爱国
-- 漂亮的分割符 --
返回数据:

{
    "status": 1,
    "data": {
        "title": "爱国",
        "pinyin": "ài guó",
        "explain": "热爱自己的国家:爱国心ㄧ爱国人士。 热爱自己的国家爱国忧民有古风",
        "jinyici_content": [
            {
                "word": "忠烈",
                "pinyin": "[zhōng liè]",
                "content": "词语释义:1.忠义壮烈。 2.指为正义而壮烈牺牲者。 3.忠诚刚正。"
            },
            {
                "word": "精忠",
                "pinyin": "[jīng zhōng]",
                "content": "词语释义:(对国家、民族)极其忠诚:精忠报国。 对国家、民族无比忠诚精忠报国"
            }
        ],
        "fanyici_content": [
            {
                "word": "卖国",
                "pinyin": "[mài guó]",
                "content": "词语释义:谓投靠敌国,出卖国家和民族利益。 投靠敌人,出卖祖国和人民的利益卖国求荣"
            }
        ]
    }
}
                
                            
代码示例:
  • Curl
  • PHP
  • Java
  • Python
  • JavaScript
  • Go
  • Nodejs

    curl -X POST \
    http://api.toolfk.com/api/fanyi-detail \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -d 'token=用户中心获取&title=%E7%88%B1%E5%9B%BD'
                                       
//记得去掉这个 "\" 斜线
<\?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.toolfk.com/api/fanyi-detail",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "token=用户中心获取&title=%E7%88%B1%E5%9B%BD",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
   

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "token=用户中心获取&title=%E7%88%B1%E5%9B%BD");
Request request = new Request.Builder()
  .url("http://api.toolfk.com/api/fanyi-detail")
  .post(body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();

Response response = client.newCall(request).execute();


                                       
import requests

url = "http://api.toolfk.com/api/fanyi-detail"

payload = "token=用户中心获取&title=%E7%88%B1%E5%9B%BD"
headers = {'Content-Type': "application/x-www-form-urlencoded"}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
var data = "token=用户中心获取&title=%E7%88%B1%E5%9B%BD";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
    if (this.readyState === 4) {
        console.log(this.responseText);
    }
});

xhr.open("POST", "http://api.toolfk.com/api/fanyi-detail");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.send(data);
                                       
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://api.toolfk.com/api/fanyi-detail"

	payload := strings.NewReader("token=用户中心获取&title=%E7%88%B1%E5%9B%BD")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer_no res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
                                       
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://api.toolfk.com/api/fanyi-detail"

        payload := strings.NewReader("{
          "token": "用户中心获取token",
          "type": "a",
          "format": "json"
        }")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer_no res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
                                       
返回状态码 status 描述参照
返回码描述
status1:表示成功,0:表示失败
data成功返回数据
errmsg失败返回数据
备注:开通API接口服务,可同时享用 www.toolfk.com 网站的会员工具。