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将使用它,而不是旋转自己的铬实例。