up
2
date
Aug 14, 2023
vip
slug
202308141645
type
Post
CreatedTime
Aug 14, 2023 08:29 AM
status
Published
tags
Code
summary
API 随机图片,想让博客图片随机产生? https://picsum.photos/900/300.webp
?random=3
category
Notion
password
IP
Email
API 随机图片,想让博客图片随机产生?
直接用下面这个链接就可以
https://picsum.photos/1600/900.jpg
![notion image](https://www.notion.so/image/https%3A%2F%2Fpicsum.photos%2F1600%2F900.jpg?table=block&id=186aaba7-7fb3-4539-9237-61e59bd9ffbf&cache=v2)
进阶用法
Easy to use, stylish placeholders
Just add your desired image size (width & height) after our URL, and you'll get a random image.
https://picsum.photos/1024/768
To get a square image, just add the size.
https://picsum.photos/800
Blur
Get a blurred image by appending
?blur
to the end of the url.https://picsum.photos/800/1200/?blur
You can adjust the amount of blur by providing a number between
1
and 10
.https://picsum.photos/800/1200/?blur=2
Advanced Usage
You may combine any of the options above.
To request multiple images of the same size in your browser, add the
random
query param to prevent the images from being cached:<img src="https://picsum.photos/200/300?random=1"> <img src="https://picsum.photos/200/300?random=2">
If you need a file ending, you can add
.jpg
to the end of the url.https://picsum.photos/200/300.jpg
To get an image in the WebP format, you can add
.webp
to the end of the url.https://picsum.photos/200/300.webp
List Images
Get a list of images by using the
/v2/list
endpoint.https://picsum.photos/v2/list
The API will return 30 items per page by default.
To request another page, use the
?page
parameter.To change the amount of items per page, use the
?limit
parameter.https://picsum.photos/v2/list?page=2&limit=100
The
Link
header includes pagination information about the next/previous pages