Normalized services

A normalized service goes one step beyond AutoSwap: the service type defines named operations with a fixed input and output shape, and every provider attaches an adapter that maps that shape onto its own API. You integrate once and APISwaps picks the provider per call.

Base URL

code
GET  https://apiswaps.com/api/gw/v1/services/<type-slug>/<operation>?field=valuePOST https://apiswaps.com/api/gw/v1/services/<type-slug>/<operation>      (JSON body)

Whether an operation is GET or POST, and which fields it takes and returns, is listed under Normalized API on the type page. Only declared input fields are forwarded; required ones are checked before any provider is called (400 invalid_input otherwise).

Example

bash
curl "https://apiswaps.com/api/gw/v1/services/geocoding/geocode?query=Berlin%20Hbf" \  -H "Authorization: Bearer sk-as-YOUR_KEY"

Provider selection and failover

The same rules as AutoSwap apply: X-AutoSwap-Strategy (cheapest · fastest · reliable, or the type's default), circuit breaker, up to three providers per call, and the X-AutoSwap-Listing / X-AutoSwap-Attempts response headers. A provider that answers but whose answer cannot be normalized is skipped as well; if nobody can serve the call you get 502 adapter_error or 503 no_provider_available.

Errors

Statuserror.typeMeaning
400invalid_inputa required field is missing or has the wrong type
4xxprovider_errorthe chosen provider rejected the call; status, provider and a message excerpt are included
502adapter_errorthe provider answered but the response could not be mapped
503no_provider_availableno provider with a working adapter can take the call right now
Need the provider's raw response? Call the listing directly through /api/gw/v1//… — normalized services always return the mapped JSON.