接入教程
访问Danbooru官方API文档获取详细教程。
Python示例
python
import requests
response = requests.get('https://danbooru.donmai.us/posts.json?tags=anime')
print(response.json())
PHP示例
php
<?php
$response = file_get_contents('https://danbooru.donmai.us/posts.json?tags=anime');
echo $response;
?>
JavaScript示例
javascript
fetch('https://danbooru.donmai.us/posts.json?tags=anime')
.then(response => response.json())
.then(data => console.log(data));
常见问题
如何获取API密钥?
Danbooru API目前不需要API密钥即可使用。
API是否有速率限制?
官方文档未明确说明速率限制,建议合理使用以避免被封禁。
Aitishiku.com