Keyword search from a simple form, no model
For developers at vendors who need reproducible filters with an audit trail. Send criteria.keywords and exclude_keywords with no brief and check false: reproducible results with the matched sentence as evidence.
What is the problem?
A simple form (operation, city, a few checkboxes for Spanish phrases) must give the same results every time, with the sentence that triggered each match, and no model in the loop.
How does it work, step by step?
- Map each checkbox to a keyword group: synonyms and the Catalan form in one group (
["salida de humos", "sortida de fums"]), each requirement in its own group. A premises meets a group when its text holds any phrase; write phrases as Spanish agencies do. - Map exclusions to
exclude_keywords. - Call
POST /v1/claro/search(REST) or search_premises withcriteria.keywords,exclude_keywordsand any data criteria (operation,cities,area_min,rent_price_max), nobrief, and"check": false. - Show each met group's
evidence(the sentence that matched) andmatched(the phrase it holds) beside the result, with theexcerptand the agency's page fromagency_links. - Page with
cursorandlimitup to 200 (paging).
curl -X POST https://platform.casafari.com/v1/claro/search \
-H "Authorization: Bearer $CASAFARI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"criteria": {"operation": "rent", "cities": ["madrid"], "keywords": [["salida de humos", "sortida de fums"], ["esquina", "chaflán"]], "exclude_keywords": ["se traspasa"]}, "check": false}'What do you get?
Exact counts, the criteria as understood, and results in which each keyword group met carries evidence and matched. Hard criteria (operation, cities, types, price, area) exclude; exclude_keywords leaves out a premises whose text holds any of its phrases. The audit trail is in the response, so store it with the result.
What are the limits?
Matching is on the advertisement text, so a feature an agency did not write down is not found. Per-account limits on calls a minute and a day apply (429 rate_limited or quota_reached), behind the platform's own limits (limits). Show excerpts and matched sentences, never the full description (content terms).