# 双端自适应随机图片

### 请求URL

```
https://www.loliapi.com/acg/
```

{% hint style="success" %}
ACG 即Animation（动画）、Comics（漫画）与Games（游戏）的首字母缩写，来源不是英语，也不是一个英语单词，并没有完全对应的广泛使用的中文翻译
{% endhint %}

### 请求参数（get）

<table><thead><tr><th width="150" align="center">参数名称</th><th width="224" align="center">参数值</th><th width="172" align="center">参数说明</th><th width="150" align="center">参数类型</th></tr></thead><tbody><tr><td align="center">id</td><td align="center">不多于图片收录数的整数</td><td align="center">指定id对应的图片</td><td align="center">可选</td></tr></tbody></table>

<table><thead><tr><th width="150" align="center">参数名称</th><th width="150" align="center">参数值</th><th width="291" align="center">参数说明</th><th width="150" align="center">参数类型</th></tr></thead><tbody><tr><td align="center">type</td><td align="center"></td><td align="center">重定向到图片源网址</td><td align="center">默认</td></tr><tr><td align="center">type</td><td align="center">url</td><td align="center">返回图片源网址</td><td align="center">可选</td></tr><tr><td align="center">type</td><td align="center">img</td><td align="center">返回图片源网址对应图片</td><td align="center">可选</td></tr><tr><td align="center">type</td><td align="center">json</td><td align="center">返回图片相关json数据</td><td align="center">可选</td></tr></tbody></table>

### 请求示例

#### 最基本调用格式

<https://www.loliapi.com/acg/>

访问会返回一个随机图片

#### 高级调用格式

如果想获取 id 为 23 的图片的 json 数据，就应该访问

<https://www.loliapi.com/acg/?id=23&type=json>

电脑端访问会返回

```
{
    "site": "www.Loliapi.com",
    "imgurl": "https:\/\/tva1.sinaimg.cn\/large\/0075ueBvly1gxct1fxp2ij31hc0u0qq0.jpg",
    "width": "1920",
    "height": "1080"
}
```

手机端访问会返回

```
{
    "site": "www.Loliapi.com",
    "imgurl": "https:\/\/tva1.sinaimg.cn\/large\/0075ueBvly1gxcsxrhtsdj312z1kwtiu.jpg",
    "width": "1403",
    "height": "2048"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.loliapi.com/api-shi-yong-wen-dang/sui-ji-er-ci-yuan-tu-pian/page-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
