Overview
We run a fintech app that validates Amazon products before purchase using Zinc's offers API. Zinc has been throwing intermittent 500s, and we need a reliable fallback using SerpApi's Amazon Product API (engine=amazon_product).
This is a focused integration into an existing Python codebase — not greenfield. You'll follow established patterns and work closely with our team.
Scope
1. Codebase analysis (before any code is written)
Review our current Zinc integration — offers API usage, validation logic, caching layers, retry behavior, and DB fallback flow. Document how each validation field is sourced and used in the purchase decision.
2. SerpApi client
Build a client that calls /search?engine=amazon_product&asin=[asin], handles errors/timeouts, and follows our existing service patterns.
3. Response mapper
Translate SerpApi's purchase_options.buy_new into our existing offer validation format:
* stock == "In Stock" → available
* Determine how to reliably identify new-condition offers from the response structure
* Delivery date strings (e.g. "FREE delivery Wednesday, December 24") → handling_days_max (requires regex + year inference)
* FBA inferred from delivery text ("shipped by Amazon", Prime mentions) — no boolean available
* extracted_price (float) → integer cents
4. Field mapping document
A clear table: each Zinc field we validate → equivalent SerpApi field → parsing approach → known gaps or limitations.
5. Fallback hook
When Zinc fails and our DB cache is stale, call SerpApi before giving up on the product.
6. Tests
Unit tests covering: happy path, out-of-stock, non-FBA, delivery parsing edge cases, and API error handling.
Tech stack
Python 3.8 · Tornado · SQLAlchemy · PostgreSQL · Redis
Key challenges worth calling out
Delivery date parsing: SerpApi returns human-readable dates with no year — you'll need regex and year-boundary inference.
FBA detection: No structured boolean from SerpApi — must be parsed from delivery/seller text.
Contract duration of less than 1 month.
Mandatory skills: Python, SQLAlchemy, Tornado, PostgreSQL