Local HTTP gateway over pyfunda for:
Operational workflow is in WORKFLOW.md.
127.0.0.1Use virtualenv in the skill root (./.venv), not in scripts/.
cd /path/to/skills/funda
if [ ! -d .venv ]; then
python3 -m venv .venv
fi
source .venv/bin/activate
pip install -r scripts/requirements.txt
python scripts/funda_gateway.py --port 9090 --timeout 10
127.0.0.1:No dedicated /health endpoint.
Use:
curl -sG "http://127.0.0.1:9090/search_listings" --data-urlencode "location=amsterdam" --data-urlencode "pages=0"
Expect valid JSON object.
GET /get_listing/{public_id}Returns listing.to_dict() from pyfunda.
Example:
curl -s "http://127.0.0.1:9090/get_listing/43243137"
GET /get_price_history/{public_id}Returns price history keyed by date.
Example:
curl -s "http://127.0.0.1:9090/get_price_history/43243137"
GET /get_previews/{public_id}Downloads listing photos, resizes/compresses to JPEG previews.
Query params:
limit (default 5, clamped 1..50)preview_size (default 320, clamped 64..1024)preview_quality (default 65, clamped 30..90)ids optional CSV of photo ids (224/802/529,224/802/532)save optional bool-like (1,true,yes,on) to save previews to diskdir optional relative path inside skill root (default previews)filename_pattern optional template; placeholders: {id}, {index}, {photo_id}Response shape:
id, count, previews[]id, url, content_typesave=0 (default): preview item includes base64save=1: preview item includes saved_path, relative_path and does not include base64Save behavior:
previews//.jpg dirdir must be relative and stay inside skill rootdir and filename_pattern preserve original letter caseExamples:
# base64 in response
curl -sG "http://127.0.0.1:9090/get_previews/43243137" \
--data-urlencode "limit=2" \
--data-urlencode "preview_size=320"
# save files (no base64 in response)
curl -sG "http://127.0.0.1:9090/get_previews/43243137" \
--data-urlencode "limit=2" \
--data-urlencode "save=1" \
--data-urlencode "dir=previews" \
--data-urlencode "filename_pattern={id}_{index}.jpg"
GET|POST /search_listingsSearch wrapper over pyfunda.search_listing.
locationoffering_typeavailabilityradius_kmprice_min, price_maxarea_min, area_maxplot_min, plot_maxobject_typeenergy_labelsortpage (single page alias)pages (single or CSV list; preferred)pages takes precedence over pagepages can be 0 or CSV like 0,1,20.3s{ "count": N, "items": [ ... ] }public_idenergy_label is normalized to uppercase (a,a+,b -> A,A+,B)Noneoffering_type is buyFor validation/upstream failures, endpoints return JSON error envelope:
{
"error": {
"code": "invalid_parameter|invalid_listing_id|listing_not_found|upstream_error",
"message": "...",
"details": { "field": "...", "reason": "..." }
}
}
Status codes:
400 invalid query/path parameter404 listing not found502 upstream/client failure while fetching dataThese are ignored because they are not in endpoint signature:
radius (use radius_km)bedrooms_minyear_minfloor_minExamples:
# minimal
curl -sG "http://127.0.0.1:9090/search_listings" \
--data-urlencode "location=amsterdam" \
--data-urlencode "pages=0"
# multi-page + filters
curl -sG "http://127.0.0.1:9090/search_listings" \
--data-urlencode "location=amsterdam" \
--data-urlencode "offering_type=buy" \
--data-urlencode "radius_km=5" \
--data-urlencode "object_type=house,apartment" \
--data-urlencode "energy_label=A,B,C" \
--data-urlencode "sort=newest" \
--data-urlencode "pages=0,1"
scripts/tls_client.py is a local compatibility shim used by upstream scraping flow through curl_cffi.
No system-level native tls_client binary is required for this skill.
共 1 个版本