随机图片api收集

KuaiKan 2022-5-27 842

这里是从网上收集来的随机图片API,可以调用

当然用人家的API就要接受倒闭不能用的风险,毕竟这个世界上没有什么东西是永久的

https://img.aibianse.com/

https://www.eee.dog/tech/rand-pic-api.html

https://www.randomench.top/random/

1、api接口整合

樱花:https://www.dmoe.cc/random.php

晓晴博客:https://acg.toubiec.cn/random.php

Unsplash Image API:

https://source.unsplash.com/random

夏沫博客:

https://cdn.seovx.com/?mom=302

https://cdn.seovx.com/d/?mom=302

https://cdn.seovx.com/ha/?mom=302

二次元随机图:https://api.blogbig.cn/random/api.php(失效)

搏天api:https://api.btstu.cn/sjbz/api.php

姬长信API:

----每日bing:https://api.isoyu.com/bing_images.php

----美女图片壁纸:https://api.isoyu.com/mm_images.php

----网红专栏壁纸:https://api.isoyu.com/beibei_images.php

----动态IP签名图片:https://api.isoyu.com/ip_images.php?signature=早安

----ARU(阿鲁)表情包:https://api.isoyu.com/ARU_GIF_S.php

樱道:https://api.r10086.com/动漫综合1.php (网站中有更多api接口)

小歪API:

----二次元动漫:https://api.ixiaowai.cn/api/api.php

----mc酱动漫:https://api.ixiaowai.cn/mcapi/mcapi.php

----高清壁纸:https://api.ixiaowai.cn/gqapi/gqapi.php

保罗|API:https://api.paugram.com/wallpaper/

墨天逸:https://api.mtyqx.cn/tapi/random.php

EEE.DOG:https://api.yimian.xyz/img

动漫星空:https://api.dongmanxingkong.com/suijitupian/acg/1080p/index.php(失效)

岁月小筑:https://img.xjh.me/random_img.php

东方Project:https://img.paulzzh.tech/touhou/random

likepoems随机图:

https://api.likepoems.com/

星港随机图片API:

https://xg.x-xh.cn/?p=251(网站中有更多api接口)

2、api网站整合

2.1 樱花

网址:https://www.dmoe.cc/

随机二次元图片API

在这里插入图片描述

2.2 晓晴博客

网址:https://www.toubiec.cn/318.html

随机二次元图片接口

在这里插入图片描述

源码项目地址:https://www.toubiec.cn/99.html

2.3 Unsplash Image API

官方网址:https://source.unsplash.com/

API地址:https://source.unsplash.com/random

简单的嵌入Unsplash图片,可以登录Unsplash账号设置,也可以自定义筛选接口的图片类型

在这里插入图片描述

2.4 夏沫博客

网址:https://cdn.seovx.com/

在线古风美图二次元API接口

在这里插入图片描述

2.5 二次元随机图(失效)

网址:https://api.blogbig.cn/random

该api已停运,原接口保持但不维护

在这里插入图片描述

2.6 搏天api

网址:https://api.btstu.cn/doc/sjbz.php

随机输出各类壁纸

在这里插入图片描述

2.7 姬长信API

网址:https://api.isoyu.com/

姬长信API For Docker 一个基于多种编程语言开源免费不限制提供生活常用,出行服务,开发工具,金融服务,通讯服务和公益大数据的平台.

在这里插入图片描述

在这里插入图片描述

2.8 樱道

网址:https://img.r10086.com/

の随机图片API接口ฅ•ﻌ•ฅ

在这里插入图片描述

2.9 小歪API

网址:https://api.ixiaowai.cn/

图片API,文字API,二维码API,随心所动不再单调

在这里插入图片描述

2.10 保罗|API

网址:https://api.paugram.com/help/wallpaper

生成适合 Single 主题的白底动漫壁纸

在这里插入图片描述

2.11 墨天逸

网址:https://api.mtyqx.cn/

随机图片API

在这里插入图片描述

2.12 EEE.DOG

网址:https://www.eee.dog/tech/rand-pic-api.html

本API基于华为云对象存储,使用华为CDN云加速,全球平均下载速度达10MB/s。API中已收录1100+张二次元图片,20+张Bing壁纸(每日自动抓取),150+张二次元头像,10+张图床上传图片。

在这里插入图片描述

2.13 动漫星空(失效)

网址:https://api.dongmanxingkong.com/

在这里插入图片描述

在这里插入图片描述

2.14 岁月小筑

网址:https://img.xjh.me/

随机图片API

在这里插入图片描述

2.15 东方Project

网址:https://img.paulzzh.tech/

随机图片API

在这里插入图片描述

2.16 likepoems随机图(本站)

网址:

https://api.likepoems.com/

随机图片API

在这里插入图片描述

2.17 星港随机图片API

网址:https://xg.x-xh.cn/?p=251

随机图片API

3、自建随机图api

准备图片--->书写路径--->书写php文件

在img文件夹里新建img.txt,文件中直接写图片的URL地址,如:

https://xxx.xxx.com/2020/09/19/14d4607426a4a4e341f8144a56fbac570.jpg
https://xxx.xxx.com/2020/09/19/ad30a36bd3c3d6bfd07f0357fa25ab710.jpg

新建index.php文件。文件内容如下:

<?php
//存放api随机图链接的文件名img.txt
$filename = "img.txt";
if(!file_exists($filename)){
    die('文件不存在');
}
 
//从文本获取链接
$pics = [];
$fs = fopen($filename, "r");
while(!feof($fs)){
    $line=trim(fgets($fs));
    if($line!=''){
        array_push($pics, $line);
    }
}
 
//从数组随机获取链接
$pic = $pics[array_rand($pics)];
 
//返回指定格式
$type=$_GET['type'];
switch($type){
 
//JSON返回
case 'json':
    header('Content-type:text/json');
    die(json_encode(['pic'=>$pic]));
 
default:
    die(header("Location: $pic"));
}
 
?>

然后放在服务器里面的api文件夹里,绑定域名,记得开启php环境

访问路径:你的域名/api/img


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回