Back to API Presets
API Preset
November 14, 2025By Product API TeamVacuum

Building a Vacuum API with The Product API: A Complete Guide

Create a specialized Vacuum Product API with type, power source, filtration, and features. Perfect for appliance marketplaces and cleaning equipment platforms.

Introduction to Vacuums

Vacuums are essential cleaning appliances for maintaining clean homes and spaces. With numerous models available from brands like Dyson, Shark, Miele, Bissell, and iRobot, finding the right vacuum with the right features can be challenging. Whether you're a homeowner looking for a powerful upright, a pet owner needing specialized pet hair removal, or a developer building an appliance marketplace, having structured vacuum product data is invaluable.

Imagine being able to search for vacuums and instantly get detailed information about each device - from suction power and filtration to bagless vs bagged design, from cordless vs corded to specialized attachments. This is exactly what a specialized Vacuum Product API can provide.

What Makes a Vacuum API Special?

A Vacuum Product API goes beyond basic product listings. It understands the unique characteristics that matter to vacuum buyers:

  • Type: Upright, canister, stick, robot, or handheld
  • Power: Suction power and motor specifications
  • Power Source: Corded, cordless, or hybrid
  • Filtration: HEPA, bagless, or bagged system
  • Capacity: Dustbin or bag capacity
  • Attachments: Specialized tools and accessories
  • Features: Pet hair removal, wet/dry capability, self-emptying
  • Battery Life: Runtime for cordless models
  • Weight: Portability and ease of use

With this structured data, you can build powerful features like filtering by vacuum type, comparing suction power, or recommending vacuums based on cleaning needs.

Try It Out: Search for Vacuums

Use the search bar below to search for vacuums. Try queries like "Dyson V15 Detect", "Shark Navigator", or "Roomba j9+". The results will include detailed specifications automatically extracted from product information across the web.

Try the Vacuum API

Search for vacuums 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 Vacuum 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 Vacuum 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., "vacuum Dyson V15")
  • 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 Vacuum-Specific JSON Schema to pass as custom_data_schema of search request

Here's the JSON Schema we use for vacuum products:

{
  "type": "object",
  "properties": {
    "vacuum_type": {
      "type": "string",
      "enum": ["upright", "canister", "stick", "robot", "handheld", "wet_dry"],
      "description": "Type of vacuum cleaner"
    },
    "power_source": {
      "type": "string",
      "enum": ["corded", "cordless", "hybrid"],
      "description": "Power source type"
    },
    "suction_power": {
      "type": "string",
      "description": "Suction power specification (e.g., '230 AW', '200 CFM')"
    },
    "motor_type": {
      "type": "string",
      "description": "Motor type (e.g., 'digital motor', 'cyclone motor')"
    },
    "filtration_system": {
      "type": "string",
      "enum": ["HEPA", "HEPA-like", "washable", "bagged", "bagless"],
      "description": "Filtration system type"
    },
    "dustbin_capacity": {
      "type": "string",
      "description": "Dustbin or bag capacity (e.g., '0.76L', '2.5L', 'bagless')"
    },
    "battery_life": {
      "type": "string",
      "description": "Battery runtime for cordless models (e.g., '60 minutes', '45 minutes')"
    },
    "charging_time": {
      "type": "string",
      "description": "Charging time for cordless models (e.g., '4 hours', '3.5 hours')"
    },
    "weight": {
      "type": "string",
      "description": "Weight in pounds or kilograms"
    },
    "cord_length": {
      "type": "string",
      "description": "Cord length for corded models (e.g., '25 feet', '30 feet')"
    },
    "pet_hair_removal": {
      "type": "boolean",
      "description": "Specialized pet hair removal capability"
    },
    "wet_dry": {
      "type": "boolean",
      "description": "Wet and dry cleaning capability"
    },
    "self_emptying": {
      "type": "boolean",
      "description": "Self-emptying base or system (for robot vacuums)"
    },
    "mapping": {
      "type": "boolean",
      "description": "Smart mapping and navigation (for robot vacuums)"
    },
    "app_control": {
      "type": "boolean",
      "description": "Smartphone app control"
    },
    "attachments": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Included attachments (e.g., ['crevice tool', 'dusting brush', 'pet tool', 'upholstery tool'])"
    },
    "height_adjustment": {
      "type": "boolean",
      "description": "Adjustable height settings"
    },
    "price_range": {
      "type": "string",
      "description": "Price range category (budget, mid-range, premium)"
    }
  },
  "required": ["vacuum_type", "power_source", "filtration_system"]
}

Using the Category Prefix

When searching for vacuums, we prefix the search query with "vacuum" to help the AI understand the context and return more relevant results.

Example Search Queries:

  • vacuum Dyson V15 Detect
  • vacuum Shark Navigator lift-away
  • vacuum Roomba j9+ robot
  • vacuum Miele canister C3

The prefix "vacuum" ensures the API understands you're looking specifically for vacuum cleaners and not other products.

Complete Example: Making a Request

Here's how to make a request to The Product API with a vacuum-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=vacuum%20Dyson%20V15&with_image=true', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    custom_data_schema: {
      type: "object",
      properties: {
        vacuum_type: {
          type: "string",
          enum: ["upright", "canister", "stick", "robot", "handheld", "wet_dry"],
          description: "Type of vacuum cleaner"
        },
        power_source: {
          type: "string",
          enum: ["corded", "cordless", "hybrid"],
          description: "Power source type"
        },
        suction_power: {
          type: "string",
          description: "Suction power specification"
        },
        motor_type: {
          type: "string",
          description: "Motor type"
        },
        filtration_system: {
          type: "string",
          enum: ["HEPA", "HEPA-like", "washable", "bagged", "bagless"],
          description: "Filtration system type"
        },
        dustbin_capacity: {
          type: "string",
          description: "Dustbin or bag capacity"
        },
        battery_life: {
          type: "string",
          description: "Battery runtime for cordless models"
        },
        charging_time: {
          type: "string",
          description: "Charging time for cordless models"
        },
        weight: {
          type: "string",
          description: "Weight"
        },
        cord_length: {
          type: "string",
          description: "Cord length for corded models"
        },
        pet_hair_removal: {
          type: "boolean",
          description: "Specialized pet hair removal capability"
        },
        wet_dry: {
          type: "boolean",
          description: "Wet and dry cleaning capability"
        },
        self_emptying: {
          type: "boolean",
          description: "Self-emptying base or system"
        },
        mapping: {
          type: "boolean",
          description: "Smart mapping and navigation"
        },
        app_control: {
          type: "boolean",
          description: "Smartphone app control"
        },
        attachments: {
          type: "array",
          items: { type: "string" },
          description: "Included attachments"
        },
        height_adjustment: {
          type: "boolean",
          description: "Adjustable height settings"
        },
        price_range: {
          type: "string",
          description: "Price range category"
        }
      },
      required: ["vacuum_type", "power_source", "filtration_system"]
    }
  })
});

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": "Dyson V15 Detect Cordless Vacuum",
      "description": "The Dyson V15 Detect features laser technology...",
      "brand": "Dyson",
      "image": "https://example.com/image.jpg",
      "custom_data": {
        "vacuum_type": "stick",
        "power_source": "cordless",
        "suction_power": "230 AW",
        "motor_type": "Hyperdymium motor",
        "filtration_system": "HEPA",
        "dustbin_capacity": "0.76L",
        "battery_life": "60 minutes",
        "charging_time": "4.5 hours",
        "weight": "6.8 lbs",
        "cord_length": "N/A",
        "pet_hair_removal": true,
        "wet_dry": false,
        "self_emptying": false,
        "mapping": false,
        "app_control": true,
        "attachments": ["laser slim fluffy cleaner head", "crevice tool", "combination tool", "mini motorized tool"],
        "height_adjustment": true,
        "price_range": "premium"
      }
    }
  ]
}

Conclusion

By combining the flexible Product API with a vacuum-specific JSON Schema, you can create a powerful, specialized API for vacuum products. The key is:

  1. Define your schema based on what vacuum data matters to your application
  2. Use category prefixes in search queries for better context
  3. 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 dishwashers, microwaves, refrigerators, and more!