Skip to content
Resource library
GOCUX / Articlesresearch

Migrating off a search API: inventory, field mapping and a safe cutover

A plan for leaving a search API you depend on: inventory every usage, map result fields, evaluate side by side on real traffic and cut over with a way back.

Search APIs get retired, repriced, restructured or quietly change their terms, and whatever was built on top has to move. The Bing Web Search API is the example many developers know: teams built products around its response format, and Microsoft has since steered developers away from the standalone Bing Search APIs toward grounding inside its own agent services. Check Microsoft's documentation for the current status and any successor offering. Whatever your reason for moving, the work follows the same four steps: find every dependency, translate the data model, prove the replacement on your own traffic, and switch without a cliff edge. This guide walks through each of them.

Inventory every place the old API is used

The obvious call site is rarely the only one. Search code and configuration for the endpoint host, the key header (Ocp-Apim-Subscription-Key in Bing's case), client libraries and environment variables. Then look past the main codebase: scheduled jobs, notebooks, a spreadsheet macro someone wrote, a partner integration that calls your service, which in turn calls the search API.

For each usage, record:

  • Which endpoints it calls: web, news, images, video, entities, autosuggest, spell check, custom search.
  • Which parameters it sends, and which response fields it actually reads.
  • Volume and pattern: interactive calls per user, batch jobs, an agent loop.
  • Whether results are stored, shown to users or passed to a model, and how long they persist.
  • Who owns it, and what visibly breaks if it stops.

The list of fields read is the most useful output. You may discover that the application touches only a handful of fields, which makes the migration smaller than feared, or that it depends on one unusual feature, which then decides the choice of replacement.

Map fields and parameters

Response fields

Define a provider-neutral result shape for internal use, and map the old provider into it before you map any new one. A sketch for web results:

Bing fieldNeutral fieldNotes for the replacement
webPages.value[].nametitleUsually a direct equivalent; check how highlighting markup comes back.
webPages.value[].urlurlNormalize URLs before comparing results across providers.
webPages.value[].snippetexcerptLength and selection logic differ, so a model may suddenly see much more or much less text.
webPages.value[].dateLastCrawledretrieved_atA crawl date, not a publication date. Do not let the new mapping blur the two.
webPages.value[].languagelanguageNot every provider returns it; decide whether you need to detect it yourself.
webPages.value[].deepLinkssublinksOften has no equivalent; check whether anything reads it.
webPages.totalEstimatedMatchesestimated_totalAn estimate, never a count; avoid logic that depends on it.
queryContext.alteredQuerycorrected_querySpelling correction varies; tell users when their query was changed.
rankingResponsenoneBing's mainline and sidebar layout hints; usually dropped, but check any interface that mirrors them.

Request parameters and behaviour

  • Market and language. Bing uses mkt codes such as en-US or tr-TR, plus setLang for interface language. A replacement may split country and language into separate parameters, or cover fewer regions.
  • Freshness. Bing's freshness filters by day, week or month. Check whether the new provider filters on publication date, crawl date or something else entirely.
  • Safe search. safeSearch levels may not map one to one; choose the stricter setting when in doubt.
  • Paging. count and offset may become cursors or page numbers, with a different maximum depth.
  • Site restriction. Queries that rely on site: operators may need a dedicated domain filter instead.
  • Verticals. News, images and video may be separate products elsewhere, or missing.

Put a thin adapter in front first

Before switching anything, route every call through one internal interface that returns the neutral shape. Ship that change with the old provider still behind it and confirm that nothing changed for users. From then on the migration is a configuration change rather than a rewrite, and the next migration will be too.

The adapter is also the right place to normalize errors. A timeout, a rate limit, an authentication failure and an empty result should come out as distinct outcomes. If the old integration collapsed some of them into an empty list, your agents may have been reporting that nothing exists while the service was actually failing. The overview of what a web search API is covers the moving parts if you are designing the interface from scratch.

Evaluate side by side on your own traffic

  1. Sample real queries from your logs across every usage type, including long-tail and non-English ones.
  2. Shadow the new provider. Send the same queries to both, keep serving users from the old one, and store both responses.
  3. Compare mechanically first: overlap of the top URLs, presence of dates, excerpt length, error and timeout rates, and response times measured from your own servers.
  4. Then grade a sample by hand, blind to which provider produced which list. Low overlap is not failure by itself; the new results may be better. Only grading tells you.
  5. Test downstream behaviour. If a model consumes the results, run the same prompts on both and compare the answers and their citations, not only the result lists.

Write the acceptance criterion before the data arrives. For example: on the graded sample, the replacement is at least as relevant as the old provider in every query class, returns a usable date on most results, and no class gets worse on errors or timeouts. The guides on evaluating web search on your own queries and judging recall and accuracy go deeper on grading.

Cut over safely

  • Move one usage at a time, lowest risk first: internal tools and batch jobs before user-facing search.
  • Use a flag so each usage can switch back without a deploy, and raise traffic gradually.
  • Watch the right signals: empty-result rate, error rate, slow-tail response time, users rephrasing their queries, and the quality of model answers that cite search.
  • Keep the old provider available until the new one has run through a full cycle of your traffic, including weekly and monthly jobs.
  • Clean up: revoke old keys, delete cached results the old terms require you to delete, and update documentation and runbooks.

Read the new provider's terms as carefully as its API reference. Storage, display and training rules differ, and a cache that was allowed under the old contract may not be allowed under the new one. For choosing the replacement itself, start with picking a web search API.

Where GoCux fits

GoCux is not a search API, so it is not a replacement candidate. A migration, though, is exactly the kind of multi-step work an agent can carry out and a team should be able to review. Framed as a GoCux work order, the job gets a goal (move the weekly news digest to the new provider), a scope (the adapter and its configuration, not unrelated services) and acceptance criteria like the one above. Each step is written to the order's record while it runs, and the work stops at an awaiting-decision state before consequential actions such as sending a report out or scheduling a recurring job, until someone on the team decides. The result, its evidence and those decisions sit on one record, which is what you want when someone later asks why the search results changed. The note on writing acceptance criteria before the agent starts explains why the criterion comes first, and the guide to specifying a task shows the fields.

Migration checklist

  • Every call site, scheduled job and indirect consumer is in the inventory, with the fields it reads.
  • A neutral result shape exists, and the old provider maps into it.
  • Crawl dates and publication dates stay separate in the mapping.
  • Market, freshness, safe search and paging behaviour are mapped or knowingly dropped.
  • The adapter returns distinct outcomes for results, empty, error, timeout and rate limit.
  • Shadow traffic ran long enough to cover weekly and monthly jobs.
  • A blind-graded sample met an acceptance criterion written in advance.
  • Each usage can switch back with a flag.
  • Old keys are revoked, and cached results are handled as the old terms require.

Bring this workflow into your workspace.

Set the scope. Review the evidence. Approve the steps that need it.

Open the workspace

Keep exploring