# GrapeFaviconAPI リファレンス

GrapeFaviconAPI リファレンス

#### 任意のドメインから簡単にファビコンを取得

***

### API概要

`GrapeFaviconAPI` を使用すると、指定されたドメインのファビコンをURL形式、または画像ファイルとして取得できます。

***

### エンドポイント

| **メソッド** | **エンドポイント**           | **説明**                  |
| -------- | --------------------- | ----------------------- |
| GET      | `/api-fav/output.png` | 指定されたドメインからファビコンを取得します。 |

***

### リクエストパラメータ

| **パラメータ** | **型**  | **必須** | **説明**                             |
| --------- | ------ | ------ | ---------------------------------- |
| `domain`  | string | Yes    | ファビコンを取得する対象のドメイン (例: example.com) |
| `type`    | string | No     | `'image'` を指定すると、ファビコン画像が直接返されます。  |

***

### レスポンス例

```json
{
  "icons": [
    "http://example.com/favicon.ico",
    "http://example.com/apple-touch-icon.png"
  ]
}
```

***

### 使用例

#### **Python**

```python
import requests

response = requests.get('https://grape.mixeder.net/api-fav/output.png', params={'domain': 'example.com'})
print(response.json())
```

***

#### **PHP**

```php
<?php
$response = file_get_contents('https://grape.mixeder.net/api-fav/output.png?domain=example.com');
print_r(json_decode($response, true));
?>
```

***

#### **cURL**

```bash
curl -X GET "https://grape.mixeder.net/api-fav/output.png?domain=example.com"
```

***

#### **Node.js**

```javascript
const https = require('https');

https.get('https://grape.mixeder.net/api-fav/output.png?domain=example.com', (res) => {
  let data = '';
  res.on('data', (chunk) => {
    data += chunk;
  });

  res.on('end', () => {
    console.log(JSON.parse(data));
  });
}).on('error', (err) => {
  console.error('エラー:', err);
});
```

***

#### **Go**

```go
package main

import (
    "encoding/json"
    "fmt"
    "io/ioutil"
    "log"
    "net/http"
)

func main() {
    resp, err := http.Get("https://grape.mixeder.net/api-fav/output.png?domain=example.com")
    if err != nil {
        log.Fatalln(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        log.Fatalln(err)
    }

    var result map[string]interface{}
    if err := json.Unmarshal(body, &result); err != nil {
        log.Fatalln(err)
    }

    fmt.Println(result)
}
```

***

#### **Ruby**

```ruby
require 'net/http'
require 'json'

uri = URI('https://grape.mixeder.net/api-fav/output.png?domain=example.com')
response = Net::HTTP.get(uri)

data = JSON.parse(response)
puts data
```

***

これらのコードを使用することで、指定されたドメインのファビコンを簡単に取得できます。\
ファビコンを画像として取得する場合は、`type=image` をリクエストに追加してください。


---

# 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://developer.mixeder.net/grapeapi/apirifarensu/grapefaviconapi-rifarensu.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.
