Introduction to Boats
Boats come in many types and configurations, from sailboats to powerboats, yachts to kayaks. Finding the right boat with the right specifications can be challenging. Whether you're a boating enthusiast seeking a sailboat, a fisherman needing a fishing boat, or a developer building a marine marketplace, having structured boat product data is crucial.
Imagine being able to search for boats and instantly get detailed information about each vessel - from boat type and length to engine specifications and capacity, from hull material to performance characteristics. This is exactly what a specialized Boat Product API can provide.
What Makes a Boat API Special?
A Boat Product API goes beyond basic product listings. It understands the unique characteristics that matter to boat buyers:
- Boat Type: Sailboat, powerboat, yacht, pontoon, fishing, and more
- Dimensions: Length, beam (width), and draft
- Engine: Type, power, and number of engines
- Capacity: Passenger capacity and sleeping accommodations
- Performance: Max speed and cruising speed
- Construction: Hull material and build quality
- Features: Navigation equipment, amenities, and marine electronics
With this structured data, you can build powerful features like filtering by boat type, comparing engine specifications, or recommending boats based on intended use.
Try It Out: Search for Boats
Use the search bar below to search for boats. Try queries like "Beneteau sailboat 40 feet", "Boston Whaler fishing boat", or "Sea Ray yacht". The results will include detailed specifications automatically extracted from product information across the web.
Try the Boat API
Search for boats and see detailed specifications automatically extracted from product information.
How It Works: Technical Implementation
Now that you've seen the API in action, let's dive into how it's implemented. This specialized Boat API is built on top of The Product API which is an AI-based product search API that works with any product and any type of query. It responds with structured JSON and supports custom structured responses, allowing you to build specialized APIs for any product category.
The Product API's powerful custom_data_schema feature allows you to define additional structured fields specific to your product category, enabling you to create category-specific APIs like this Boat API. For more details on how the API works, see the full documentation.
Understanding APIs for Product Data
An API (Application Programming Interface) enables different software applications to communicate. For product data:
- Input: You send a search query (e.g., "boat Beneteau sailboat")
- Processing: The API searches across multiple sources and uses AI to extract relevant information
- Output: You receive structured product data in JSON format
The flexibility of a product API means you can customize it for specific categories by defining additional data fields through JSON Schema.
Creating a Boat-Specific JSON Schema to pass as custom_data_schema of search request
Here's the JSON Schema we use for boat products:
{ "type": "object", "properties": { "boat_type": { "type": "string", "enum": ["sailboat", "powerboat", "yacht", "pontoon", "fishing", "speedboat", "catamaran", "jet_ski", "kayak", "canoe", "paddleboard"], "description": "Type of boat" }, "length": { "type": "string", "description": "Boat length in feet or meters" }, "beam": { "type": "string", "description": "Boat width (beam) in feet or meters" }, "engine_type": { "type": "string", "enum": ["outboard", "inboard", "sterndrive", "jet", "none"], "description": "Engine type" }, "engine_power": { "type": "string", "description": "Engine power in horsepower" }, "engine_count": { "type": "number", "description": "Number of engines" }, "fuel_capacity": { "type": "string", "description": "Fuel tank capacity in gallons or liters" }, "passenger_capacity": { "type": "number", "description": "Maximum passenger capacity" }, "sleeping_capacity": { "type": "number", "description": "Number of berths/sleeping accommodations" }, "hull_material": { "type": "string", "enum": ["fiberglass", "aluminum", "wood", "composite", "inflatable"], "description": "Hull material" }, "max_speed": { "type": "string", "description": "Maximum speed in knots or mph" }, "cruising_speed": { "type": "string", "description": "Cruising speed in knots or mph" }, "year": { "type": "number", "description": "Manufacturing year" }, "price_range": { "type": "string", "description": "Price range category" } }, "required": ["boat_type", "length"] }
Using the Category Prefix
When searching for boats, we prefix the search query with "boat" to help the AI understand the context and return more relevant results.
Example Search Queries:
boat Beneteau sailboat 40 feetboat Boston Whaler fishingboat Sea Ray yachtboat Yamaha jet ski
The prefix "boat" ensures the API understands you're looking specifically for boats and not other products.
Complete Example: Making a Request
Here's how to make a request to The Product API with a boat-specific schema. For complete API reference including authentication, endpoints, and all parameters, see the documentation:
const response = await fetch('https://api.example.com/api?search=boat%20Beneteau%20sailboat&with_image=true', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY' }, body: JSON.stringify({ custom_data_schema: { type: "object", properties: { boat_type: { type: "string", enum: ["sailboat", "powerboat", "yacht", "pontoon", "fishing", "speedboat", "catamaran", "jet_ski", "kayak", "canoe", "paddleboard"], description: "Type of boat" }, length: { type: "string", description: "Boat length in feet or meters" }, beam: { type: "string", description: "Boat width (beam)" }, engine_type: { type: "string", enum: ["outboard", "inboard", "sterndrive", "jet", "none"], description: "Engine type" }, engine_power: { type: "string", description: "Engine power in horsepower" }, engine_count: { type: "number", description: "Number of engines" }, fuel_capacity: { type: "string", description: "Fuel tank capacity" }, passenger_capacity: { type: "number", description: "Maximum passenger capacity" }, sleeping_capacity: { type: "number", description: "Number of berths/sleeping accommodations" }, hull_material: { type: "string", enum: ["fiberglass", "aluminum", "wood", "composite", "inflatable"], description: "Hull material" }, max_speed: { type: "string", description: "Maximum speed in knots or mph" }, cruising_speed: { type: "string", description: "Cruising speed in knots or mph" }, year: { type: "number", description: "Manufacturing year" }, price_range: { type: "string", description: "Price range category" } }, required: ["boat_type", "length"] } }) }); const data = await response.json(); console.log(data.products);
Expected Response
The API will return products with standard fields plus your custom custom_data field:
{ "status": "success", "products": [ { "name": "Beneteau Oceanis 40.1", "description": "The Beneteau Oceanis 40.1 is a modern cruising sailboat...", "brand": "Beneteau", "image": "https://example.com/image.jpg", "custom_data": { "boat_type": "sailboat", "length": "40.3 feet", "beam": "13.9 feet", "engine_type": "inboard", "engine_power": "30 hp", "engine_count": 1, "fuel_capacity": "21 gallons", "passenger_capacity": 8, "sleeping_capacity": 6, "hull_material": "fiberglass", "max_speed": "8 knots", "cruising_speed": "6 knots", "year": 2023, "price_range": "premium" } } ] }
Conclusion
By combining the flexible Product API with a boat-specific JSON Schema, you can create a powerful, specialized API for boat products. The key is:
- Define your schema based on what boat data matters to your application
- Use category prefixes in search queries for better context
- Leverage the custom_data field to build rich, category-specific features
The same approach works for any product category - you just need to define the right schema for your needs!
Ready to get started? Create your own product API on The Product API and start building your own category-specific APIs today!
Ready to build your own category-specific API? Check out our other API preset guides for trucks, scooters, motorcycles, and more!