common-apis

July 28, 2021 · View on GitHub

一些通用的node api,部分接口使用的前端在线例子:每日一看

用vercel Functions做代理转发,结果被vercel封号了,目前域名都通不了。暂时不能在线看效果。用gitpod或者clone到本地吧..囧 暂时解封了..

开发

shell

  • clone仓库到本地
git clone git@github.com:bowlofnoodles/common-apis.git
  • 启动
npm install
npm run dev
# visit http://localhost:627

也可以尝试一下gitpod在线打开(就是可能机子不好的话有点慢):gitpod在线地址

来源

  • 爬虫html
  • 爬虫api
  • 调用别人现成接口(做规整和调整自己想要的数据)

返回结构说明

  • 正常
{
  "status": 200, // 正确都是200
  "data" "[]" // 接口返回数据
}
  • 错误
{
  "status": 500, // 错误代码
  "message" "错误"  // 错误信息
}

API

点击url,可以查看获取结果。 因为是部署在heroku上,所以有点慢...现在部署在阿里云上了,好多了... 阿里云域名备案没备案,vercel代理的项目因为一些原因下线,所以暂时还用heroku。等我找到下一个白嫖能够解析代理到阿里云。

微博相关

/weibo/hot_spot

获取微博热搜

  • 返回结构说明:
参数说明类型默认值
iconText话题火爆程度描述string-
rank排序number'top'
title标题string-
view已看人数number-
src详情链接string-

豆瓣相关

/douban/top_250

获取豆瓣电影top250

  • 参数说明:
参数说明类型默认值
start起始数number0

由于没找到豆瓣的每页数量的参数是啥,所以默认每页都是25条,start参数为起始数。

  • 返回结构说明:
参数说明类型默认值
rank排名number-
picUrl海报图片string-
url详情链接string-
star豆瓣评分number-
comment评价人数number-
title标题string-
desc描述string-
quote简述string-