ConvertAPI
ConvertAPI リファレンス
サービス名
ConvertAPI
利用用途
ConvertAPI
は、指定した画像ファイルをアスキーアート(ASCII Art)に変換するAPIです。アスキーアートは、画像の輝度情報を基に文字を組み合わせて生成される視覚的表現で、画像をテキスト形式に変換して表示したい場合に利用されます。
API エンドポイント
https://events-front.mixeder.net/ConvertAPI/
パラメータ
パラメータ
必須
説明
key
必須
利用者のAPIキー
from
必須
変換する画像ファイルのURL
利用方法
有効なAPIキーを用意します。
変換したい画像のURLを
from
パラメータに指定します。上記のパラメータを使ってリクエストを送信すると、アスキーアートが返されます。
サンプルレスポンス
@@@@@@@@@@@@@@@@@@
@@&&&*******::::::
@@&&&*******::::::
@@@@@@@@@@@@@@@@@@
サンプルコード
cURL
curl "https://events-front.mixeder.net/ConvertAPI/?key=YOUR_API_KEY&from=https://example.com/sample.jpg"
Node.js
const https = require('https');
const url = 'https://events-front.mixeder.net/ConvertAPI/?key=YOUR_API_KEY&from=https://example.com/sample.jpg';
https.get(url, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
console.log(data);
});
}).on('error', (err) => {
console.error('Error: ' + err.message);
});
Python
import requests
url = "https://events-front.mixeder.net/ConvertAPI/"
params = {
"key": "YOUR_API_KEY",
"from": "https://example.com/sample.jpg"
}
response = requests.get(url, params=params)
if response.status_code == 200:
print(response.text)
else:
print(f"Error: {response.status_code}")
エラーメッセージ
API Key not provided.: APIキーが指定されていません。
Query[From] not provided.: 画像のURLが指定されていません。
API key is wrong: APIキーが無効です。
注意事項
画像ファイルのURLは外部から直接参照できる形式である必要があります。
適切なAPIキーを使用しないと、リクエストは拒否されます。
これで、ConvertAPI
を利用して画像をアスキーアートに変換するための手順が整いました。
最終更新
役に立ちましたか?