JsonGenius
1.0.0
Jsongenius是一種自託管的刮擦API,它提取JSON模式描述的結構化數據。提供任何URL和所需的JSON模式,Jsongenius將從網站返回結構化數據。

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 :用於從網站提取數據的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將使用它,而不是旋轉自己的鉻實例。