JsonGenius
1.0.0
JSongeniusは、JSONスキーマによって記述された構造化されたデータを抽出する自己ホストのスクレイピングAPIです。任意のURLと目的のJSONスキーマを提供すると、JSongeniusはWebサイトから構造化されたデータを返します。

OPEN_AI_KEY -openaiのAPIキー。ここで無料で入手できます。これは、環境変数として設定する必要があります。 git clone https://github.com/semanser/jsongenius
cd jsongenius
export OPEN_AI_KEY= < your key here >
docker compose up APIはhttp:// localhost:3001で利用できます。 docker-compose.ymlファイルを編集して、ポートを変更できます。
git clone https://github.com/semanser/jsongenius
cd jsongenius
export OPEN_AI_KEY= < your key here >
go build .
./jsongeniusこのエンドポイントは、次のフィールドを持つJSONボディを受け入れます。
url :削るウェブサイトのURLschema :Webサイトからデータを抽出するために使用するJSONスキーマ。スキーマは有効なJSONスキーマオブジェクトでなければなりません。 JSONスキーマの詳細については、こちらをご覧ください。 curl -X POST -H " Content-Type: application/json " -d ' {
"url": "https://www.amazon.com/s?k=gaming+headsets",
"schema": {
"type": "object",
"properties": {
"products": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The product name"
},
"price": {
"type": "number",
"description": "The price of the product in USD"
}
}
}
}
}
}
} ' http://localhost:3001/lookupWS_URL環境変数を設定できます。 Jsongeniusは、独自のChromiumインスタンスを紡ぐ代わりに、それを使用します。