Git Product home page Git Product logo

lauraaddams / skincareapi Goto Github PK

View Code? Open in Web Editor NEW
92.0 10.0 22.0 737 KB

An api of over 2,000 popular skincare products in the US, Korea, and Japan. Users can search by brand, product name, or any ingredient and receive a list of products matching. User can also add to the database or paginate their results. Made with Ruby on rails as part of the Capstone for Ada Developers Academy.

Ruby 99.31% HTML 0.69%

skincareapi's Introduction

SkincareAPI

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.

API

Base URL

GET https://skincare-api.herokuapp.com

Products

GET /products

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",
        ]
    },
]

GET /products/1

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",
    ]
}

POST /products

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,..."

Ingredients

GET /ingredients

Returns a list of all unique ingredients

[
    {
        "id": 1,
        "ingredient": "water"
    },
    {
        "id": 2,
        "ingredient": "butylene glycol"
    },
    {
        "id": 3,
        "ingredient": "alcohol"
    },
]

Queries

Products and ingredients can both be queried at their singular route

GET /product?q=rose+water

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."
        ]
    },
]

GET /ingredient?q=rose+water

Searches ingredient for LIKE values

[
    {
        "id": 2493,
        "ingredient": "rose water"
    },
    {
        "id": 3103,
        "ingredient": "damask rose water"
    }
]

Query Pagination

Addition params can be sent for pagination results

  • limit (default 10)
  • page

Example

GET https://skincare-api.herokuapp.com/product?q=rose&limit=25&page=1

Cheatsheet

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)

skincareapi's People

Contributors

lauraaddams avatar

Stargazers

sabrina avatar Alekzandriia avatar Charvi Singh avatar Lahfir avatar  avatar im2rnado avatar Valeria Zhdanova avatar  avatar  avatar Mr Bushido  avatar Thato Pearl avatar Ana Catarina Santos avatar Amy Nagelberg avatar  avatar  avatar  avatar Sondos Khalifa avatar HiST avatar  avatar Nicholas Do avatar Laura Fonseca avatar Munirah Shamsudin avatar J_Theinmoliie avatar Khushali avatar Amie Philpot avatar Linda Givers avatar Wilbur Zhang avatar Jenniffer Meng avatar Adrian Alvarez avatar Tiffani Hess avatar Meghann avatar  avatar b avatar sky jung avatar Roh avatar Pamela Stankova avatar Keshvi Mahalingam avatar Thu Ha Le (Hannah) avatar Ayush Soni avatar  avatar Eric Xie avatar Wisam Halawi avatar  avatar  avatar  avatar  avatar Betty avatar  avatar Beatriz Mariño Albert avatar Rosanna D'Vaz avatar Hannah Glazier avatar Isabel avatar Ari S. avatar Ashley Kang avatar Nikita Dorokhov avatar Alex Cui avatar María Paz C. avatar  avatar daolq avatar  avatar Rheannone avatar Ying Ling avatar  avatar Jeremy Dang avatar Sabrina Marzuki avatar Ross Harding avatar CutieRei avatar Gigagon avatar Adil Fathi avatar Ankur Purwar avatar Pabi Moloi avatar Cody Um avatar Anna Dekiert avatar Gabrielle Sant'Anna avatar Sharna Hossain avatar Sole avatar Bogdan Floria avatar Stephanie Ditzler avatar Nicole Bernadette Ong avatar Leo avatar  avatar todun avatar Aimie avatar Katie Doroschak avatar  avatar Bertan Ege Teberci avatar Joanna Sese avatar Linda Phan avatar Stacy B. Little avatar Ann Marie Garrett avatar Jonny Dubowsky avatar carson chang avatar

Watchers

James Cloos avatar Bogdan Floria avatar Anna Dekiert avatar  avatar  avatar Aimie avatar Linda Phan avatar  avatar CutieRei avatar  avatar

skincareapi's Issues

CORS

I'm making a skincare web app as my capstone project (backend: Node/Express, frontend: React/Redux) and am trying to use this skincare API for it, but I'm running into a CORS issue after deployment (screenshot attached). I'm only calling this API through my frontend and I was hoping the author could add headers that would accept my requests. Is there anyone here calling the API who had this problem and solved it? Or are there other people using this API who are able to use it without issue, and what is your setup? Thanks in advance!
Screen Shot 2021-04-29 at 1 06 54 PM

Endpoints

Do the endpoints not work anymore? :(

Product data source

Hi - don’t know if this is still being actively maintained, but I came across this super cool repo. Was reading the API documentation, and I find your product ingredient data exceptionally clean. Did you have to clean it up before you work on the API, or is there a data source you obtained those clean data from? We are a company that provides personal care product shopping advice based on toxicity of ingredients, and are having trouble getting cleaned source of ingredient data for the products we are analyzing… Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.