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.
To run the Cannabis API locally, follow these steps:
Clone the repository:
git clone https://github.com/Piyush-Bhor/The_Cannabis_API.git
Navigate to the project directory:
cd The_Cannabis_API
Install the dependencies:
npm install
Set up the MongoDB connection:
.env
file.Start the server:
npm start
The Cannabis API is now running locally on http://localhost:3000
.
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.
The Cannabis API is deployed on Heroku and can be accessed at https://the-cannabis-api.herokuapp.com/strains.
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 on the GitHub repository.
The Cannabis API is released under the MIT License. Please see the LICENSE file for more details.
For any questions or inquiries, please reach out to project maintainer Piyush Bhor:
Feel free to provide feedback or report
any issues. Enjoy using the Cannabis API!