{% endraw %}
> This API does not promise **permanent** maintenance, please be sure to consider **use risks** before use! !
## 1 API address
- `https://api.yimian.xyz/img`
## 2 Quick start
***Random two-dimensional picture***
- `GET/POST /img?type=moe`
- Example: [https://api.yimian.xyz/img?type=moe](https://api.yimian.xyz/img?type=moe)
***Random Bing Wallpaper***
- `GET/POST /img?type=wallpaper`
- Example: [https://api.yimian.xyz/img?type=wallpaper](https://api.yimian.xyz/img?type=wallpaper)
***Random two-dimensional avatar***
- `GET/POST /img?type=head`
- Example: [https://api.yimian.xyz/img?type=head](https://api.yimian.xyz/img?type=head)
***Random bed pictures***
- `GET/POST /img?type=imgbed`
- Example: [https://api.yimian.xyz/img?type=imgbed](https://api.yimian.xyz/img?type=imgbed)
***Random 1920x1080 size two-dimensional picture***
- `GET/POST /img?type=moe&size=1920x1080`
- Example: [https://api.yimian.xyz/img?type=moe&size=1920x1080](https://api.yimian.xyz/img?type=moe&size=1920x1080)
## 3 Parameter list
{% raw %}
{% endraw %}
Name | Description | Format | Example
:---:| :---: | :---: | :---:
**type** | Image type | `moe`/`wallpaper`/`head`/`imgbed` | `type=moe`
**size** | Filter by image size | `??x??`;
`*x??`;
`*x*`;
`??-??x?? `;
`??-??x??-??`;
`??-??x*` | `display=1920x1080`;
`display=1920x*`;
`display=1920-1950x230-500`;
`display=1920-1950x*`;
**range** | Size error range | number | `range=100`
**id** | Filter by image id | number | `id=15`
**path** | Extract pictures based on path | abs path | `path=wallpaper/img_··mal.jpg`
**display** | Whether to display in web page format | `true`/`false`(default) | `display=true`
**R18** | Whether to display 18 prohibited pictures | `true`/`false`(default) | `R18=true`
{% raw %}
{% endraw %}
## 4 Detailed parameters
### 4.1 type
***Two-dimensional (default)***
- `GET/POST /img?type=moe`
- Image source: Daily Collection of Miao Miao Jiang (Pivix, Twitter)
- Example: [https://api.yimian.xyz/img?type=moe](https://api.yimian.xyz/img?type=moe)
***bing daily wallpaper***
- `GET/POST /img?type=wallpaper`
- Image source: Bing Daily Wallpaper
- Example: [https://api.yimian.xyz/img?type=moe](https://api.yimian.xyz/img?type=wallpaper)
> Automatically updated daily
***Two-dimensional avatar***
- `GET/POST /img?type=head`
- Image source: Selectively intercepted from two-dimensional images
- Example: [https://api.yimian.xyz/img?type=head](https://api.yimian.xyz/img?type=head)
***Miao meow sauce picture bed***
- `GET/POST /img?type=imgbed`
- Image source: [呓喵酱图床](https://imgbed.yimian.xyz)
- Example: [https://api.yimian.xyz/img?type=imgbed](https://api.yimian.xyz/img?type=imgbed)
***こいぬちゃん***
- `GET/POST /img?type=koino`
- Image source: @九条だんぼ (Twitter, Pivix, Google)
- Example: [https://api.yimian.xyz/img?type=koino](https://api.yimian.xyz/img?type=koino)
***EasyVer man-machine verification***
- `GET/POST /img?type=easyver`
- Image source: Optimized finishing
- Example: [https://api.yimian.xyz/img?type=easyver](https://api.yimian.xyz/img?type=easyver)
### 4.2 display
If this parameter is set to true, 302 jump will be disabled and the complete picture encoding will be returned directly. This method is **very low** and slow. Please use it carefully.
**false (default)**
- `GET/POST /img?display=false`
- Description: 302 Jump to return to the picture, recommended
- Example: [https://api.yimian.xyz/img?display=false](https://api.yimian.xyz/img?display=false)
**true**
- `GET/POST /img?display=true`
- Description: Return to the picture directly, slow
- Example: [https://api.yimian.xyz/img?display=true](https://api.yimian.xyz/img?display=true)
### 4.3 size
Use this parameter to limit the image size. This parameter supports the following formats:
***??x??***
- `GET/POST /img?size=??x??`
- Description: width x height
- Example: [https://api.yimian.xyz/img?size=1920x1080](https://api.yimian.xyz/img?size=1920x1080)
***??x\****
- `GET/POST /img?size=??x*`
- Description: width x any height
{% raw %}
Example: https://api.yimian.xyz/img?size=1920x*
{% endraw %}
***\*x??***
- `GET/POST /img?size=*x??`
- Description: Any width x height
{% raw %}
Example: https://api.yimian.xyz/img?size=*x1080
{% endraw %}
***\*x\****
- `GET/POST /img?size=*x*`
- Description: any width x any height (default)
{% raw %}
Example: https://api.yimian.xyz/img?size=*x *
{% endraw %}
***??-??x??***
- `GET/POST /img?size=??-??x??`
- Description: width range x height
- Example: [https://api.yimian.xyz/img?size=1910-1930x1080](https://api.yimian.xyz/img?size=1910-1930x1080)
***??x??-??***
- `GET/POST /img?size=??x??-??`
- Description: width x height range
- Example: [https://api.yimian.xyz/img?size=1920x1070-1090](https://api.yimian.xyz/img?size=1920x1070-1090)
***??-??x??-??***
- `GET/POST /img?size=??-??x??-??`
- Description: width range x height range
- Example: [https://api.yimian.xyz/img?size=1910-1930x1070-1090](https://api.yimian.xyz/img?size=1910-1930x1070-1090)
***??-??x\****
- `GET/POST /img?size=??-??x*`
- Description: width range x any height
{% raw %}
Example: https://api.yimian.xyz/img?size=1910 -1930x*
{% endraw %}
***\*x??-??***
- `GET/POST /img?size=*x??-??`
- Description: Any width x height range
{% raw %}
Example: https://api.yimian.xyz/img?size=* x1070-1090
{% endraw %}
### 4.4 range
This parameter specifies the allowable size error, which needs to be used with size, and the default is 0.
***For the?? type size parameter***
- `GET/POST /img?size=??x??&range=100`
- Description: width ±100 x height ±100
- Example: [https://api.yimian.xyz/img?size=1920x1080&range=100](https://api.yimian.xyz/img?size=1920x1080&range=100)
***For??-?? type size parameter***
- `GET/POST /img?size=??-??x??-??&range=100`
- Description: Min width-100|Max width+100 x Min height-100|Max height+100
- Example: [https://api.yimian.xyz/img?size=1910-1930x1070-1090&range=100](https://api.yimian.xyz/img?size=1910-1930x1070-1090&range=100)
***For *type size parameter***
- `GET/POST /img?size=*x*&range=100`
- Description: Invalid range
### 4.5 id
Each category has its own id system, and different image ids under the same category are unique.
***Two-dimensional ***
- `GET/POST /img?type=moe&id=15`
- Description: Extract the two-dimensional image with id 15
- Example: [https://api.yimian.xyz/img?type=moe&id=15](https://api.yimian.xyz/img?type=moe&id=15)
***bing daily wallpaper***
- `GET/POST /img?type=wallpaper&id=2019-07-28`
- Description: Extract wallpaper pictures from 2019-07-28
- Example: [https://api.yimian.xyz/img?type=wallpaper&id=2019-07-28](https://api.yimian.xyz/img?type=wallpaper&id=2019-07-28)
***Two-dimensional avatar***
- `GET/POST /img?type=head&id=15`
- Description: Extract the avatar with id 15
- Example: [https://api.yimian.xyz/img?type=head&id=15](https://api.yimian.xyz/img?type=head&id=15)
***Miao meow sauce picture bed***
- `GET/POST /img?type=imgbed&id=529745e0`
- Description: Extract the picture bed with id 529745e0
- Example: [https://api.yimian.xyz/img?type=imgbed&id=529745e0](https://api.yimian.xyz/img?type=imgbed&id=529745e0)
### 4.6 path
Use absolute path to directly extract pictures, priority is higher than type, **highest efficiency**.
- `GET/POST /img?path=xx/xx.xx`
- Path format: `Type/Picture File Name`
- Example of path format: `imgbed/img_529745e0_900x900_8_null_normal.jpeg`
- Description: Extract pictures in xx/xx.xx
- Example: [https://api.yimian.xyz/img/?path=imgbed/img_529745e0_900x900_8_null_normal.jpeg](https://api.yimian.xyz/img/?path=imgbed/img_529745e0_900x900_8_null_normal.jpeg)
### 4.7 R18
Whether to display 18 prohibited pictures, the default is false.
- `GET/POST /img?type=xx&R18=true`
- Description: Randomly extract pictures containing R18 content in xx category
- Example: [https://api.yimian.xyz/img/?type=koino&R18=true](https://api.yimian.xyz/img/?type=koino&R18=true)
## 5 Error format
### 5.1 Cannot find the specified type
If the specified type cannot be found, a moe type picture will be automatically returned.
### 5.2 Can't find matching images
Return JSON
```js
{
"err": "error message"
}
```
>The maximum number of **global calls** for each device is 500 per day!!
{% raw %}{% endraw %}