Skip to main content
This endpoint lets you search the Black Hair API product catalog by ingredient. Pass an ingredient name to retrieve every active product that contains it, or set exclude=true to find products that do not include that ingredient — useful for customers with sensitivities or who follow ingredient-avoidance routines such as the Curly Girl Method.

Endpoint

GET https://api.blackhairapi.com/v1/ingredients/products

Request headers

HeaderValueRequired
X-API-Keybha_...Yes

Query parameters

name
string
required
The ingredient name to search for within product ingredient lists (e.g. shea butter, mineral oil, dimethicone). The search is case-insensitive and matches against the raw ingredient list stored for each product.
exclude
boolean
When true, the response contains products that do not include the named ingredient. When false (default), the response contains products that do include it. Useful for building ingredient-free product filters.

Response

ingredient
string
The ingredient name you supplied in the request, returned as-is for confirmation.
exclude
boolean
Reflects the exclude flag used for this query. false means results contain the ingredient; true means results exclude it.
product_count
integer
The total number of products returned in this response.
products
array of objects
The matched products. Each item in the array contains the following fields.

Examples

Find products containing shea butter

curl -X GET \
  "https://api.blackhairapi.com/v1/ingredients/products?name=shea+butter" \
  -H "X-API-Key: bha_your_key_here"
{
  "ingredient": "shea butter",
  "exclude": false,
  "product_count": 3,
  "products": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Moisture Retention Conditioner",
      "brand": "SheaMoisture",
      "category": "conditioner",
      "buy_url": "https://www.example.com/products/moisture-retention-conditioner"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "Curl Enhancing Smoothie",
      "brand": "Cantu",
      "category": "styling cream",
      "buy_url": "https://www.example.com/products/curl-enhancing-smoothie"
    },
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-012345678902",
      "name": "Deep Treatment Masque",
      "brand": "Mielle Organics",
      "category": "deep conditioner",
      "buy_url": "https://www.example.com/products/deep-treatment-masque"
    }
  ]
}

Find products that exclude mineral oil

curl -X GET \
  "https://api.blackhairapi.com/v1/ingredients/products?name=mineral+oil&exclude=true" \
  -H "X-API-Key: bha_your_key_here"
{
  "ingredient": "mineral oil",
  "exclude": true,
  "product_count": 2,
  "products": [
    {
      "id": "d4e5f6a7-b8c9-0123-defa-123456789012",
      "name": "Avocado & Tea Tree Oil Leave-In",
      "brand": "As I Am",
      "category": "leave-in conditioner",
      "buy_url": "https://www.example.com/products/avocado-tea-tree-leave-in"
    },
    {
      "id": "e5f6a7b8-c9d0-1234-efab-234567890123",
      "name": "Flaxseed Elongating Curling Gel",
      "brand": "Eco Style",
      "category": "gel",
      "buy_url": "https://www.example.com/products/flaxseed-curling-gel"
    }
  ]
}

Error responses

StatusMeaning
401Missing or invalid X-API-Key header.
422The required name query parameter was not provided.
429You have exceeded your plan’s monthly request limit.
Matching is performed against the raw ingredient list text for each product. For best results, use common ingredient names (e.g. cetyl alcohol, glycerin) rather than trade names.