每日美文API接口

每日一篇有深度有涵养美文摘抄,经典书摘好文章大全,每日精选意境唯美的段落摘抄文章。

接口文档 《查看会员》
接口地址: http://api.toolfk.com/api/everyarticle
请求方法: [ "GET", "POST" ]
请求参数:
名称 类型 描述 示例
token string 请求的token 用户中心获取token
-- 漂亮的分割符 --
返回数据:

{
    "status": 1,
    "data": {
        "title": "不能回来的猫",
        "author": "井上荒野",
        "digest": "她要去日本的东京出公差。在去机场的路上,她告诉他,她决定要离开他。他看上去已经接受了这个现实,他没有悲痛,更没有质问什么。晚一些时候,一场暴",
        "content": "<p>她要去日本的东京出公差。在去机场的路上,她告诉他,她决定要离开他。他看上去已经接受了这个现实,他没有悲痛,更没有质问什么。</p><p>晚一些时候,一场暴风雨造访了这个城市。他们一起被困在了家中,这个家,他们已经住了三年,这是他们共度的最后一个夜晚。房子里小小的事物和细节都在提醒着他们的过往和以前的生活。但是他们似乎不想把时间的指针拨回那些快乐的日子,他们看上去都对对方的决定进行了妥协。雨下得更大了,他们发现了一只在家里储藏间的房顶上躲雨的小猫。他们把猫带到了家中。因为害怕,小猫很快就跑开然后躲起来了。这个时候,门铃响了。来的是他们的邻居。邻居到他们家里找自己跑丢的小猫。邻居的到来让这对即将分开的夫妻倍感尴尬和不快。但是,也正是因为邻居的到来,他们之间的情感和那些细微的感觉也似乎重新回来了。电话铃响了,来电话的是一个男人。他就是她要离开他的理由--那个她的婚外恋情人。在电话里,她告诉他,她想在这栋房子里多呆一个晚上,因为暴风雨淹没了大桥的缘故。难道她已经回心转意了?</p><p>邻居走了。小猫还是没有露面。他们开始准备自己的最后的晚餐。他在剥洋葱皮,强烈的刺激让他泪流不止。他走到卫生间洗脸,但是眼泪却越洗越多,难道真的只是洋葱让他流泪么?当晚餐准备得差不多的时候,小猫出现了。她一把抱起小猫,笑眯眯地安慰小猫--又像在安慰自己说:\"事情只会越来越好了。\"</p>"
    }
}
                
                            
代码示例:
  • Curl
  • PHP
  • Java
  • Python
  • JavaScript
  • Go
  • Nodejs

    curl -X POST \
    http://api.toolfk.com/api/everyarticle \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -d 'token=用户中心获取'
                                       
//记得去掉这个 "\" 斜线
<\?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.toolfk.com/api/everyarticle",
  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=用户中心获取",
  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=用户中心获取");
Request request = new Request.Builder()
  .url("http://api.toolfk.com/api/everyarticle")
  .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/everyarticle"

payload = "token=用户中心获取"
headers = {'Content-Type': "application/x-www-form-urlencoded"}

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

print(response.text)
var data = "token=用户中心获取";

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/everyarticle");
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/everyarticle"

	payload := strings.NewReader("token=用户中心获取")

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

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

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

	async 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/everyarticle"

        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)

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

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

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