Bing Search
Overview
Use this skill to turn a natural-language Bing search request into Dataify Bing Search API fields, call the API through scripts/bing_search.py, and return the API response directly to the user without summarizing, parsing, or post-processing it.
The source API document is summarized in references/api.md. Read it when field behavior, allowed values, or response shape is unclear.
Workflow
- Identify the user's actual search query and map requirements to API fields:
q: search terms. Required.json: output format. Default to1for JSON when the user does not specify an output format. Use2for JSON plus HTML,3for HTML.location: named geographic search origin.latandlon: GPS search origin.mkt: display language and market, such aszh-CNoren-US. Do not pass it unless the user asks for a market/language.cc: two-letter country or region code, such asus,cn,jp,uk. Do not pass it unless the user asks for a country/region.first: organic result offset. Default to1when the user does not specify it.safeSearch:Off,Moderate, orStrict.filters: advanced Bing filter string.no_cache:trueto bypass cache,falseto use cache. Default tofalsewhen the user does not specify it.
- Apply defaults only when the parameter description states a default. Current defaults from the API description are
engine=bing,q=pizza,json=1,first=1, andno_cache=false. Do not treat body examples such aslocation=India,lat=1,lon=1,mkt=zh-cn, orcc=ARas defaults. - Prefer explicit user-provided field values over inferred values. If the user asks for a concrete search, replace the documented default
q=pizzawith the user's actual query. - Before every live API call, show the user a complete request parameter table and ask whether to modify it. Do not show
Authorization. Use:
python3 scripts/bing_search.py --prompt "<user request>" --show-params
The table must include exactly these columns: parameter name, current value, default value, and description. Wait for user confirmation before calling the API.
5. Use the bundled Python script with python3. Pass the whole user request through --prompt and add explicit flags for any fields that should override automatic parsing.
6. Ensure authentication before a live call:
- Read
DATAIFY_API_TOKENfrom the current environment. - If the user provides a token during the task, set
DATAIFY_API_TOKENin the environment for the command before invoking the script. - The script adds a
Bearerprefix when the token does not already include one. - If no token is available, the script exits with a Chinese prompt; ask the user to input a Dataify API token or register at Dataify Dashboard.
- Run a dry run when you need to inspect parsed payload JSON without calling the API:
python3 scripts/bing_search.py --prompt "Search Bing for current OpenAI news, return JSON and HTML" --dry-run
- Run a live call only after the user confirms the parameter table:
python3 scripts/bing_search.py --prompt "Search Bing for current OpenAI news, return JSON and HTML"
- Return the script output directly to the user. Do not summarize the search results, extract fields, reformat JSON, parse embedded JSON strings, or process returned HTML unless the user separately asks for processing.
Script Usage
The script supports automatic parsing plus explicit overrides:
python3 scripts/bing_search.py \
--prompt "Find current OpenAI news, return JSON and HTML" \
--no-cache true
Useful flags:
--q,--json,--location,--lat,--lon,--mkt,--cc,--first,--safeSearch,--filters,--no-cache--field key=valuefor any supported API field--urlto override the fixed endpoint only when explicitly needed for debugging--tokento provide a token for the current run--body-format form|json, defaultform--dry-runto print the parsed payload and skip network/auth checks--show-paramsto print the complete pre-call parameter table and exit
If a live call fails because DATAIFY_API_TOKEN is missing, ask the user to provide a token or register at Dataify Dashboard.
微信扫一扫