Use a server-side integration
Keep your XAPI China key in a server environment variable or secret manager. Your frontend calls your own backend, which makes authenticated XAPI requests. Cache or store the fields your application needs without exposing the key to visitors. Use separate key labels for environments so you can revoke one integration independently. They still share the account’s request quota and rate limit.Set timeouts and retry selectively
- Set connection and overall request timeouts.
- Honor
Retry-Afteron throttling or temporary-service errors. - Retry transient
502/503responses with bounded backoff and jitter. - Correct
401,404, and422responses before trying again. - Stop monthly-quota retries until the allowance renews or the plan changes.
Cache useful responses
The backend’s default cache periods are 30 minutes for searches/catalogs, one hour for vehicle details, and one day for inspection reports. These are configurable server settings. Stale cached data may be served during upstream failures. Cache useful results in your integration as well. Reuse thephotos already returned in a detail response instead of making an unnecessary image request. A successful cached API response still counts against quota.
Preserve source context
Retain listing IDs, source URLs, native fields, report provider names, dates, and coverage indicators. Listings can change or disappear, exchange rates can change, and report links can expire. Recheck price and availability when they matter to your workflow. Keep unknown data unknown. Do not show a vehicle as accident-free merely because report data is unavailable or an insurance-event lookup returned no records.Monitor usage
Use Dashboard → Usage for recent requests and monthly consumption.GET /v1/me checks your current allowance without using a data request. Rotate exposed keys promptly from the dashboard.