Code Monkey home page Code Monkey logo

api-npm's Introduction

AiZhiQian随机图API食用说明

不来这里抽个卡嘛~( •̀ ω •́ )y → Gacha

本随机图API基于 islandworld 分享的数据,B站美图UP主们分享的图片和咱搜集的壁纸制作,图片 绿色健康

随机图API及图床均已转为使用某些白嫖服务搭建,故为保障使用体验和稳定性,API有一定的调用限制,具体见下文

食用方法

API地址:https://api-github.img11.eu.org/random
API地址:https://api-npm.img11.eu.org/random
API地址:https://api-bili.img11.eu.org/random
API地址:https://api-vika.img11.eu.org/random
调用方法:GET

速率和每日额度限制说明:

API限制:每IP每5秒内可以调用3次API,超出返回429

此外,请注意,每个IP每24小时内仅可通过API获取10000张图片 达到限度后将无法使用API,API地址返回状态码403并给出恢复时间

您可以 访问这里 以在不消耗额度的情况下查询您IP的剩余可用额度或可用额度恢复倒计时

传入参数说明:

键描述 值类型 可用的值 值描述
sort 索引的图片集 (可选,默认为approve) Text random
people
anime
nature
other
phone
索引全部图片
索引美女图片
索引漫画图片
索引自然图片
索引其他图片
索引手机壁纸
type 输出方法 (可选,默认为重定向) Text text
json
输出文本
输出JSON格式
num 输出图片数量 (可选,当num大于1时type固定为json) Integer 小于等于100的任意正整数
若不携带num则默认为1
thumbnail 使用缩略图(可选) Text large
medium
small
最长边重设为800px
最长边重设为176px
最长边重设为96px
only_check 检查可用额度 (可选,当此参数为任意真值时其它参数无效) Any 任意真值,或不携带此参数

Note: 图片均来自互联网,来源众多无法确认版权信息,侵删

Demo:

GET https://api-github.img11.eu.org/random
GET https://api-github.img11.eu.org/random?thumbnail=large
GET https://api-github.img11.eu.org/random?sort=people
GET https://api-github.img11.eu.org/random?sort=anime&type=text
GET https://api-github.img11.eu.org/random?sort=nature&num=100
GET https://api-github.img11.eu.org/random?only_check=true

返回参数说明:

注意:当携带num参数且num参数大于等于2时,API只会输出JSON格式

传入type 返回值 Demo
text 图片URL https://img.nahida.fun/2023/02/05/63e1b85fb27e9.jpg
json pic: 图片URL(s)数组 remain_num: 剩余额度 { "pic": ["https:\/\/img.nahida.fun\/2023\/02\/05\/63e1b85fb27e9.jpg"],"remain_num": 2333 }
其它 重定向到图片URL

将随机图API设置为网页背景

Demo(CSS):

html:before {
    background: url(https://api-github.img11.eu.org/random) no-repeat center 0/cover;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    content: "";
}

为了避免页面加载被过大的背景图阻塞导致加载缓慢,也可换用下面的方法

Demo(HTML):

<style>
.withBg:before {
    background: url(https://api-github.img11.eu.org/random) no-repeat center 0/cover;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    content: "";
}
</style>
<script>window.onload = () => document.documentElement.classList.add("withBg");</script>

一个输出壁纸轮播HTML的API

API地址:https://api-github.img11.eu.org/player
调用方法:GET

传入参数说明:

键描述 值类型 值描述
time 每张图片的持续时间,单位为秒 (可选,默认为10) Integer 大于等于5的任意正整数
若不携带time则默认为5

以下是在网页中插入随机轮播背景的使用例

Demo(HTML):

<iframe src="https://api-github.img11.eu.org/player?time=10" style="position:fixed;top:0;left:0;width:100%;height:100%;z-index:-1;border:none;overflow:hidden;"></iframe>

API调用统计

图片总数 总调用量 总图片查看量 今日调用量 今日图片查看量
95475 14447 17332 55 55

Note:时区使用UTC+0

鸣谢

随机图API的搭建离不开以下B站UP主的分享,在此表达衷心的感谢!(UID正序)

islandworld PaoMianの 轻百萌豚 星绘汐音 一只喵喵酱y
諸星小紬 玟w玟_ 奶昔酱不会忧郁丶 约尔yuer 和之凌雪
小朱不只是可爱 游手好闲的孟极 萌村百科

友情链接

非常好用的AI以图识番(Gal)网站:AnimeTrace

图床缓存由 Cloudflare 提供服务 亚太加速由 雨云 提供服务 图床源站由 Microsoft Azure 提供服务 部分方法已在 GitHub 开源


2022-2023: Nahida.Fun Made with ♡ by ZiAzusa

api-npm's People

Contributors

aizhiqian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.