npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

api-interface

v2.0.14

Published

API-Interface

Downloads

6

Readme

目录

服务器部署

返回列表目录

git clone https://github.com/Lete114/API-Interface.git API-Interface ## 克隆源码
cd API-Interface
npm install ## 安装依赖
npm run start ## 启动服务

嵌入其它项目

返回列表目录

安装

npm i api-interface

引入

const APIInterface = require('api-interface')

APIInterface.bing({}).then((res) => {
  console.log('res', res)
  // res {
  //   startdate: '2022-10-09',
  //   enddate: '2022-10-10',
  //   title: '穿越意大利峡湾之旅',
  //   copyright: '瓦伦蒂诺大坝,意大利伦巴第大区布雷西亚省 (© wmaster890/Getty Images)',
  //   cover: [
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_UHD.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_1920x1200.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_1920x1080.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_1366x768.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_1280x768.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_1024x768.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_800x600.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_800x480.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_768x1280.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_720x1280.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_640x480.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_480x800.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_400x240.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_320x240.jpg',
  //     'https://www.bing.com/th?id=OHR.ValvestinoDam_ZH-CN8397604653_240x320.jpg'
  //   ]
  // }
})

APIInterface.videoDouyin({ url: 'https://v.douyin.com/MNHBD8d/' }).then((res) => {
  console.log('res', res)
  // res {
  //   author: {
  //     nick: '王玉萌',
  //     avatar: [
  //       'https://p26.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_14a12a9ab604700dbefc5ec4094026ea.jpeg?from=116350172',
  //       'https://p3.douyinpic.com/aweme/720x720/aweme-avatar/tos-cn-avt-0015_14a12a9ab604700dbefc5ec4094026ea.jpeg?from=116350172',
  //       'https://p6.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_14a12a9ab604700dbefc5ec4094026ea.jpeg?from=116350172'
  //     ],
  //     desc: '抖音音乐木星计划成员\n' +
  //       '今日直播时间:晚22:30-3:00\n' +
  //       'wb🧣:还在努力的王玉萌\n' +
  //       '网易云/酷狗/Q:王玉萌 \n' +
  //       '合作🌟:hz-flow16\n' +
  //       '不玩回森 有事wb私信'
  //   },
  //   video: {
  //     title: '辛巴巴巴噜比啦~ #симпа #辛巴巴巴噜比啦  #q音宝藏',
  //     paly: [
  //       'https://aweme.snssdk.com/aweme/v1/play/?video_id=v0200f810000c0n4c4vtij5kpv3luijg&ratio=720p&line=0',
  //       'https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f810000c0n4c4vtij5kpv3luijg&ratio=720p&line=0'
  //     ]
  //   },
  //   music: {
  //     author: '王玉萌',
  //     title: '歌名_Симпа一王玉萌(原声中的歌曲:Simpa Pa Pa-Citethsea)',
  //     play: 'https://sf3-cdn-tos.douyinstatic.com/obj/ies-music/6930554295213443848.mp3',
  //     cover: {
  //       cover_thumb: 'https://p26.douyinpic.com/img/aweme-avatar/tos-cn-avt-0015_14a12a9ab604700dbefc5ec4094026ea~c5_168x168.jpeg?from=116350172',
  //       cover_medium: 'https://p3.douyinpic.com/aweme/720x720/aweme-avatar/tos-cn-avt-0015_14a12a9ab604700dbefc5ec4094026ea.jpeg?from=116350172',
  //       cover_large: 'https://p11.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_14a12a9ab604700dbefc5ec4094026ea.jpeg?from=116350172'
  //     }
  //   },
  //   cover: {
  //     cover: 'https://p26-sign.douyinpic.com/tos-cn-p-0015/7c780d935f8447f282a0f3fd30caa9ea_1613645426~c5_300x400.jpeg?x-expires=1666584000&x-signature=4sdDi1nxZJPFQ4AfD5Ccx37Nyss%3D&from=3213915784_large&s=PackSourceEnum_DOUYIN_REFLOW&se=false&sc=cover&l=202210101210170102080451553E3F2B16',
  //     dynamic_cover: 'https://p26-sign.douyinpic.com/obj/tos-cn-p-0015/e38001afd4234dfebdf7db697ad4bc91_1613645425?x-expires=1666584000&x-signature=ElxLZu5dgF3NJCGsPQjpX7eBYAY%3D&from=3213915784_large',
  //     origin_cover: 'https://p26-sign.douyinpic.com/tos-cn-p-0015/83d5433d7c114ce8915eca796073f846_1613645425~tplv-dy-360p.jpeg?x-expires=1666584000&x-signature=odnv8PJ7%2BHLN4XkeAk3f47linCc%3D&from=3213915784&se=false&biz_tag=feed_cover&l=202210101210170102080451553E3F2B16'
  //   }
  // }
})

API

请求方法: GET

响应内容: JSON

site

返回列表目录

/-/site?url=https://www.example.com

请求参数

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------------------------------------------------------------------------------------------ | | url | ✅ | string | 请求的网站 | | type | | string | 当该字段等于 image 时,返回参数会新增一个 redirect 值为网站的 favicon 地址,同时会重定向到该地址 |

bing

返回列表目录

/-/bing

请求参数

| 昵称 | 必填 | 类型 | 描述 | | ------ | ---- | ------ | ------------------------------------------------------------------------------------------------------------------------------ | | region | | string | Bing 每日壁纸的不同地区,每个地区的壁纸都不一样,默认: en-US,可选: zh-CN, en-US, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA | | type | | string | 当该字段等于 image 时,返回参数会新增一个 redirect 值为壁纸的地址,同时会重定向到该地址 | | date | | string | 指定一个日期,获取这个日期的壁纸,目测只能获取当前日期的前 10 天的壁纸 | | dpi | | string | 修改 redirect 默认的壁纸分辨率 |

qqAvatar

返回列表目录

/-/qq/avatar?qq=123456

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------------------------------------------------------------------------------- | | qq | ✅ | string | 要获取的 QQ 号头像 | | type | | string | 当该字段等于 image 时,返回参数会新增一个 redirect 值为头像的地址,同时会重定向到该地址 |

qqNick

返回列表目录

/-/qq/nick?qq=123456

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------ | | qq | ✅ | string | 要获取的 QQ 号头像 |

qqStatus

/-/qq/status?qq=123456

返回列表目录

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------ | | qq | ✅ | string | 要获取的 QQ 号头像 |

videoDouyin

/-/video/douyin?url=https://www.example.com

返回列表目录

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------------------------------------------------------------------------------- | | url | ✅ | string | 可以是分享的短链接、长链接、视频 ID | | type | | string | 当该字段等于 image 时,返回参数会新增一个 redirect 值为视频的地址,同时会重定向到该地址 |

videoHuoshan

返回列表目录

/-/video/huoshan?url=https://www.example.com

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------------------------------------------------------------------------------- | | url | ✅ | string | 可以是分享的短链接、长链接、视频 ID | | type | | string | 当该字段等于 image 时,返回参数会新增一个 redirect 值为视频的地址,同时会重定向到该地址 |

videoPipixia

/-/video/pipixia?url=https://www.example.com

返回列表目录

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------------------------------------------------------------------------------- | | url | ✅ | string | 可以是分享的短链接、长链接、视频 ID | | type | | string | 当该字段等于 image 时,返回参数会新增一个 redirect 值为视频的地址,同时会重定向到该地址 |

videoWeishi

返回列表目录

/-/video/weishi?url=https://www.example.com

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------------------------------------------------------------------------------- | | url | ✅ | string | 可以是分享的链接、视频 ID | | type | | string | 当该字段等于 image 时,返回参数会新增一个 redirect 值为视频的地址,同时会重定向到该地址 |

videoZuiyou

/-/video/zuiyou?url=https://www.example.com

返回列表目录

| 昵称 | 必填 | 类型 | 描述 | | ---- | ---- | ------ | ------------------------------------------------------------------------------------------- | | url | ✅ | string | 可以是分享的链接、视频 ID | | type | | string | 当该字段等于 image 时,返回参数会新增一个 redirect 值为视频的地址,同时会重定向到该地址 |