# WebInfoAPI

**Website Data API リファレンス**

Website Data API は、指定されたウェブサイトのタイトル、メタ情報、ファビコン、および IP アドレスを取得するためのシンプルなAPIです。ウェブサイト情報の集約やメタデータ解析などに便利で、WebスクレイピングやSEOツール、コンテンツ管理システム (CMS) の補助として活用できます。

### エンドポイント

```
https://events-front.mixeder.net/v2/webinfoapi
```

### パラメータ

| パラメータ | 必須 | 説明                  |
| ----- | -- | ------------------- |
| `url` | はい | 情報を取得したいウェブサイトのURL。 |
| key   | はい | APIキー               |

### レスポンス形式

* レスポンスはJSON形式で返され、以下の情報が含まれます。

| フィールド     | 説明               |
| --------- | ---------------- |
| `title`   | ウェブサイトのタイトル      |
| `meta`    | ウェブサイトのメタ情報 (配列) |
| `favicon` | ウェブサイトのファビコンURL  |
| `ip`      | ウェブサイトのIPアドレス    |

#### サンプルレスポンス

```json
{
    "title": "MixederInternet - 高速で安全なサービスを全ての人に",
    "meta": {
        "viewport": "width=device-width,initial-scale=1,shrink-to-fit=no",
        "description": "高速で安全なサービスを全ての人に",
        "keywords": "{{ MixederInternet,MIXEDERInternet,MIXEDER,ミキサー,Mixeder }}",
        "format-detection": "telephone=no,email=no,address=no"
    },
    "favicon": "https:\/\/www.mixeder.net\/static.mixeder.net\/favicon.png",
    "ip": "104.21.67.124"
}
```

### エラーレスポンス

* パラメータが不足している、または無効な場合、エラーメッセージが返されます。

| フィールド   | 説明       |
| ------- | -------- |
| `error` | エラーメッセージ |

#### エラー例

```json
{"error": "URL parameter is missing."}
{"error": "Invalid URL."}
{"error": "Failed to fetch the website."}
```

***

### 利用用途

Website Data API は以下のような用途に使用できます。

1. **SEOおよびコンテンツ管理**\
   各ページのタイトルやメタ情報を抽出してSEOデータベースを作成したり、各ウェブページの重要なメタデータを分析・管理する用途で使用できます。
2. **スクレイピングツールや情報収集アプリ**\
   ウェブサイトの基本情報 (タイトルやメタデータ) を収集し、データベースとして蓄積したり、他のツールで利用するためのベースデータとして活用可能です。
3. **コンテンツのプレビュー**\
   ソーシャルメディアなどで共有する際にページのタイトルやファビコンを取得し、見やすいプレビュー表示を作成するのに役立ちます。
4. **ウェブ分析とパフォーマンスモニタリング**\
   ウェブサイトのIPアドレスを取得して地域別の分析やアクセス時間帯の調査、またネットワークパフォーマンスを監視するツールの一部として使用できます。
5. **ドキュメンテーションや教育目的**\
   サンプルサイトのメタ情報を取得し、JSONデータの使い方やDOM解析の実例として教育目的で活用することが可能です。

***

#### 利用例

**PHPコードサンプル**

特定のURLの情報を取得し、表示するPHPコード例：

```php
<?php
$url = 'https://example.com';
$response = file_get_contents('https://events-front.mixeder.net/v2/webinfoapi?url=' . urlencode($url));
$data = json_decode($response, true);
print_r($data);
```


---

# 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/mixederpublicapis/apirifarensu/webinfoapi.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.
