JsonGenius
1.0.0
Jsongenius เป็น API การขูดที่โฮสต์ตัวเองซึ่งแยกข้อมูลที่มีโครงสร้างที่อธิบายโดยสคีมา JSON ให้ URL และสคีมา JSON ที่ต้องการและ JSongenius จะส่งคืนข้อมูลที่มีโครงสร้างจากเว็บไซต์

OPEN_AI_KEY - คีย์ API สำหรับ openai คุณสามารถรับฟรีได้ที่นี่ ควรตั้งค่าเป็นตัวแปรสภาพแวดล้อม 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 : URL ของเว็บไซต์เพื่อขูดschema : JSON Schema ที่จะใช้เพื่อแยกข้อมูลจากเว็บไซต์ สคีมาจะต้องเป็นวัตถุสคีมา JSON ที่ถูกต้อง อ่านเพิ่มเติมเกี่ยวกับ JSON Schema ที่นี่ 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 ที่ชี้ไปที่จุดสิ้นสุดของโปรโตคอล Chrome Devtools Jsongenius จะใช้สิ่งนั้นแทนที่จะหมุนอินสแตนซ์โครเมียมของตัวเอง