Skip to content

The Cannabis API provides comprehensive information about cannabis strains. Built with Node.js, Express, and MongoDB.

Notifications You must be signed in to change notification settings

Piyush-Bhor/The_Cannabis_API

Repository files navigation

The Cannabis API

Cannabis API Logo

The Cannabis API is a RESTful API that provides comprehensive information about various cannabis strains. It allows you to query and retrieve details such as strain name, type (indica, sativa, or hybrid), rating, effects, flavors, and descriptions. The API is built using Node.js, Express, and MongoDB, and it is hosted on Heroku. The dataset used to populate the API is sourced from Kaggle, specifically the "cannabis.csv" file.

Installation

To run the Cannabis API locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Piyush-Bhor/The_Cannabis_API.git
  2. Navigate to the project directory:

    cd The_Cannabis_API
  3. Install the dependencies:

    npm install
  4. Set up the MongoDB connection:

    • Make sure you have MongoDB installed and running locally or provide a remote MongoDB connection URI.
    • Update the MongoDB connection details in the .env file.
  5. Start the server:

    npm start
  6. The Cannabis API is now running locally on http://localhost:3000.

API Endpoints

The following API endpoints are available:

  • GET /strains/getStrainsById/:strainID: Retrieves a specific strain by its ID.
  • GET /strains/getStrainsByName/:strainName: Retrieves strains by name.
  • GET /strains/getStrainsByType/:strainType: Retrieves strains by type.
  • GET /strains/getStrainsByEffect/:strainEffect: Retrieves strains by effect.
  • GET /strains/getStrainsByFlavour/:strainFlavour: Retrieves strains by flavor.
  • GET /strains/getEffectsByStrainId/:strainID: Retrieves effects by strain ID.
  • GET /strains/getFlavorsByStrainId/:strainID: Retrieves flavors by strain ID.
  • GET /strains/getAllFlavors: Retrieves all flavors.
  • GET /strains/getAllEffects: Retrieves all effects.

For detailed information on how to use each endpoint, including request/response examples, please refer to the API documentation.

Deployment

The Cannabis API is deployed on Heroku and can be accessed at: https://the-cannabis-api.herokuapp.com.

Contributing

Contributions to the Cannabis API project are welcome! If you find any bugs, have suggestions for improvements, or would like to add new features, please submit an issue or open a pull request.

License

The Cannabis API is released under the MIT License. Please see the LICENSE file for more details.

Dataset

The dataset used in this project is sourced from Kaggle: cannabis.csv. The "cannabis.csv" file contains the strain data used to populate the API.

Contact

For any questions or inquiries, please reach out to project maintainer Piyush Bhor:

About

The Cannabis API provides comprehensive information about cannabis strains. Built with Node.js, Express, and MongoDB.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published