AutoSwap
Some marketplace APIs implement the same service type — the same endpoints with the same request and response shape. AutoSwap lets you call the type instead of one provider: APISwaps picks the best listing for every call and fails over when a provider is down.
Base URL
https://apiswaps.com/api/gw/v1/auto/<type-slug>/<path>Type pages under /marketplace (look for AutoSwap routes) list the contract endpoints and the providers behind each type. Authentication, billing and limits are the same as for the marketplace gateway.
Strategy
Send X-AutoSwap-Strategy to choose how the provider is picked; every type has a default when you do not:
| Strategy | Picks |
|---|---|
cheapest | the lowest price per call for that endpoint |
fastest | the lowest typical latency over the last 7 days |
reliable | the highest 7-day success rate |
curl "https://apiswaps.com/api/gw/v1/auto/geocoding/geocode?q=Berlin" \ -H "Authorization: Bearer sk-as-YOUR_KEY" \ -H "X-AutoSwap-Strategy: fastest"Failover
If the chosen provider answers with a 5xx or does not answer at all, APISwaps retries the next best provider (up to three per call). Only the call that succeeded is billed. Requests without a body always fail over; bodies up to 1 MB are replayed to the next provider; larger bodies are sent once.
Response headers
| Header | Meaning |
|---|---|
X-AutoSwap-Listing | slug of the listing that served the call |
X-AutoSwap-Strategy | strategy that was applied |
X-AutoSwap-Attempts | how many providers were tried |
X-Request-Id | id of the final attempt (matches your usage page) |