SkincareAPI is a skincare product API. The API was created as part of a capstone project for Ada Developers Academy.
The idea is to provide users with a catalog of products with brand, name, and ingredients that can be used for test projects.
GET https://skincare-api.herokuapp.com
Returns a list of all products
[
{
"id": 1,
"brand": "amorepacific",
"name": "age spot brightening pen",
"ingredient_list": [
"water",
"butylene glycol",
"alcohol",
]
},
{
"id": 2,
"brand": "amorepacific",
"name": "all day balancing care serum",
"ingredient_list": [
"camellia sinensis leaf water",
"phyllostachis bambusoides juice",
"panax ginseng root extract",
]
},
{
"id": 3,
"brand": "amorepacific",
"name": "bio-enzyme refining complex",
"ingredient_list": [
"panax ginseng root extract",
"cyclopentasiloxane",
"dimethicone",
]
},
]
Returns a single product by id number
{
"id": 1,
"brand": "amorepacific",
"name": "age spot brightening pen",
"ingredient_list": [
"water",
"butylene glycol",
"alcohol",
"dipropylene glycol",
"peg-75",
"glycereth-26",
"ascorbyl glucoside",
]
}
Adds a product, new ingredients are added to the ingredient database
Accepted params (all fields must be present):
- brand (string)
- name (string)
- ingredients (string, separated by commas) ex. "water,alcohol,citric acid,..."
Returns a list of all unique ingredients
[
{
"id": 1,
"ingredient": "water"
},
{
"id": 2,
"ingredient": "butylene glycol"
},
{
"id": 3,
"ingredient": "alcohol"
},
]
Products and ingredients can both be queried at their singular route
Searches brand, name, and ingredients for LIKE values
[
{
"id": 564,
"brand": "lioele",
"name": "a.c control mousse cleanser trouble hunter",
"ingredient_list": [
"water",
"ammonium lauryl sulfate",
"cocamidopropyl betaine",
"peg-8",
"polysorbate 20",
"salicylic acid",
"fragrance",
"henoxyethanol",
"potassium hydroxide",
"methylparaben",
"sodium methyl cocoyl taurate",
"sodium citrate",
"tetrasodium edta",
"dipotassium glycyrrhizate",
"tocopheryl acetate",
"benzophenone-4",
"rose water",
"camillia sinensis leaf extract."
]
},
]
Searches ingredient for LIKE values
[
{
"id": 2493,
"ingredient": "rose water"
},
{
"id": 3103,
"ingredient": "damask rose water"
}
]
Addition params can be sent for pagination results
- limit (default 10)
- page
GET https://skincare-api.herokuapp.com/product?q=rose&limit=25&page=1
Method | Endpoint | Description |
---|---|---|
GET | /products |
Returns an array of product |
GET | /products/:id |
Returns an object with matching :id . If the id doesn't exist response will be 404 |
POST | /products |
Adds a new product with the correct params. Invalid entries response will be 400 |
GET | /ingredients |
Returns an array of ingredient |
GET | /product?q= |
Returns an array of searched product . Empty array for no results (pagination params: limit, page) |
GET | /ingredient?q= |
Returns an array of searched ingredient . Empty array for no results (pagination params: limit, page) |