Giter VIP home page Giter VIP logo

yoga-api's Introduction

Yoga API 🧘‍♀️

API Rest returning yoga categories and poses including details and images in SVG and png format. If your response looks different, it is normal, modifications can happen. Any new pose or suggestion feel free to reach out or open an issue. The base url is:

https://yoga-api-nzy4.onrender.com/v1

Endpoints usage (get)

  • /categories -- all categories
    • /categories?id=value -- category by id
    • /categories?name=value -- category by name
    • /categories?id=value&level=value -- category poses filtered by level
  • /poses -- all poses
    • /poses?id=value -- pose by id
    • /poses?name=value -- pose name
    • /poses?level=value -- poses filtered by level

* level: beginner, intermediate, expert

* name : english and not sanskrit or adpated

* nothing is case-sensitive

Request base URL:

https://yoga-api-nzy4.onrender.com/v1

Response:

{
  "base": "https://yoga-api-nzy4.onrender.com/v1",
  "categories": "/categories",
  "category-by-id": "/categories?id=value",
  "category-by-name": "/categories?name=value",
  "category-byID-and-level": "/categories?id=value&level=value",
  "poses": "/poses",
  "pose-by-id": "/poses?id=value",
  "pose-by-name": "/poses?name=value",
  "poses-by-level": "/poses?level=value"
}

The base URL is the root of the URL. If you ever make a request and you get back a 404 NOT FOUND response, then check the base URL first.

Categories

Endpoints

  • /categories
  • /categories?id=value
  • /categories?name=value
  • /categories?id=value&level=value

Example request categories:

https://yoga-api-nzy4.onrender.com/v1/categories

Example response:

[
  {
    "id": 1,
    "category_name": "Core Yoga",
    "category_description": "Engage your abdominal muscles with core yoga poses that build a strong and stable center like Boat Pose, Dolphin Pose and Side Plank Pose.",
    "poses": [ {...}, {...}, {...}, {...}, {...}]
  },
  {
    "id": 2,
    "category_name": "Seated Yoga",
    "category_description": " Yoga practice with seated poses that help you find better alignment, increase your flexibility, and relieve lower back pain and discomfort. Tone the belly, massage your internal organs, and relieve lower back pain in these seated yoga poses. ",
    "poses": [ {...}, {...}, {...}, {...}, {...}]
  }
]

Example request category by id or name:

https://yoga-api-nzy4.onrender.com/v1/categories?id=4
https://yoga-api-nzy4.onrender.com/v1/categories?name=Chest Opening Yoga

Example response:

{
  "id": 4,
  "category_name": "Chest Opening Yoga",
  "category_description": "Open your heart and shoulders in chest opening yoga poses like Camel Pose, Fish Pose and Wild Thing.",
  "poses": [ {...}, {...}, {...}, {...}, {...}]

}

Example request category poses filtered by level:

https://yoga-api-nzy4.onrender.com/v1/categories?id=5&level=beginner

Example response:

 {
  "id": 5,
  "category_name": "Backbend Yoga",
  "category_description": "Discover the powerful effects of yoga backbends with step-by-step instructions, sequences, and expert advice to keep your practice pain-free.",
  "poses": [
     {
      "id": 8,
      "category_name": "Backbend Yoga",
      "difficulty_level": "Beginner",
      "english_name": "Cow",
      "sanskrit_name_adapted": "Bitilasana",
      "sanskrit_name": "Bitilāsana",
      "translation_name": "bitil = cow, āsana = posture",
      "pose_benefits": "From  box neutral the ribcage is lifted with a gentle sway in the low back.  The tailbone lifts up into dog tilt.  The eyes are soft and the gaze is to the sky.",
      "url_svg": "https://res.cloudinary.com/dko1be2jy/image/upload/fl_sanitize/v1676483077/yoga-api/8_wi10sn.svg",
      "url_png": "https://res.cloudinary.com/dko1be2jy/image/upload/fl_sanitize/v1676483077/yoga-api/8_wi10sn.png",
      "url_svg_alt": "https://www.dropbox.com/s/neau4ceai1rskh6/cow.svg?raw=1"
    },
    {...},
    {...},
    {...}
  ]
}

Example category not found:

HTTP/1.0 400 Bad request
Content-Type: application/json
{
  "message": "category not found"
}

Poses

Endpoints

  • /poses
  • /poses?id=value
  • /poses?name=value
  • /poses?level=value

Example request poses:

https://yoga-api-nzy4.onrender.com/v1/poses

Example response:

[ {...}, {...}, {...}, {...}, {...}]

Example request pose by Id or by name:

https://yoga-api-nzy4.onrender.com/v1/poses?id=5
https://yoga-api-nzy4.onrender.com/v1/poses?name=butterfly

Example response:

{
  "id": 5,
  "english_name": "Butterfly",
  "sanskrit_name_adapted": "Baddha Konasana",
  "sanskrit_name": "Baddha Koṇāsana",
  "translation_name": "baddha = bound, koṇa = angle, āsana = posture",
  "pose_description": "In sitting position, bend both knees and drop the knees to each side, opening the hips.  Bring the soles of the feet together and bring the heels as close to the groin as possible, keeping the knees close to the ground.  The hands may reach down and grasp and maneuver the feet so that the soles are facing upwards and the heels and little toes are connected.  The shoulders should be pulled back and no rounding of the spine.",
  "pose_benefits": "Opens the hips and groins.  Stretches the shoulders, rib cage and back.  Stimulates the abdominal organs, lungs and heart.",
  "url_svg": "https://res.cloudinary.com/dko1be2jy/image/upload/fl_sanitize/v1676483074/yoga-api/5_i64gif.svg",
  "url_png": "https://res.cloudinary.com/dko1be2jy/image/upload/fl_sanitize/v1676483074/yoga-api/5_i64gif.png",
  "url_svg_alt": "https://www.dropbox.com/s/3h2pts6xbn28dh7/butterfly%3F.svg?raw=1"
}

Example request poses level:

https://yoga-api-nzy4.onrender.com/v1/poses?level=intermediate

Example response:

{
  "id": 2,
  "difficulty_level": "Intermediate",
  "poses": [ {...}, {...}, {...}, {...}, {...}]
}

Example pose not found:

HTTP/1.0 400 Bad request
Content-Type: application/json
{
  "message": "pose not found"
}

Installation

    # Clone repo
    $ git clone [email protected]:alexcumplido/yoga-api.git
    # Install dependencies
    npm install
    yarn install
    # Run project
    npm start
    yarn start

Contributing

  1. Fork the repo
  2. Create a new branch
  3. Implement changes
  4. Commit and submit a pull request with a description

Credits

This API includes custom data and info from already existing projects. Credits to:

Contact

📫 Reach me via linkedin

yoga-api's People

Contributors

alexcumplido avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.