A Cannabis Reports API wrapper for Node.js
This project uses modern ES2016+ syntax, which means you can use promises (as shown in the documentation) or async/await.
npm install --save cannabis-reports
import { Strain, Flower, Extract, Edible, Product, Producer, SeedCompany, Dispensary } from 'cannabis-reports';
Only import the modules you need. For example, if you only need the Strain
and Extract
modules:
import { Strain, Extract } from 'cannabis-reports';
To set your API Key, set the environment variable CANNABIS_REPORTS_API_KEY
. Alternatively, you can set the configuration manually
import { setCannabisReportsKey } from 'cannabis-reports';
setCannabisReportsKey('<your-api-key>')
- Strain.all()
- Strain.search()
- Strain.strain()
- Strain.user()
- Strain.reviews()
- Strain.effectsFlavors()
- Strain.seedCompany()
- Strain.genetics()
- Strain.children()
- Strain.availability()
- Flower.all()
- Flower.type()
- Flower.flower()
- Flower.user()
- Flower.reviews()
- Flower.effectsFlavors()
- Flower.producer()
- Flower.strain()
- Flower.availability()
- Extract.all()
- Extract.type()
- Extract.extract()
- Extract.user()
- Extract.reviews()
- Extract.effectsFlavors()
- Extract.producer()
- Extract.strain()
- Extract.availability()
- Edible.all()
- Edible.type()
- Edible.edible()
- Edible.user()
- Edible.reviews()
- Edible.effectsFlavors()
- Edible.producer()
- Edible.strain()
- Edible.availability()
- Product.all()
- Product.type()
- Product.product()
- Product.user()
- Product.reviews()
- Product.effectsFlavors()
- Product.producer()
- Product.strain()
- Product.availability()
- Producer.all()
- Producer.producer()
- Producer.user()
- Producer.extracts()
- Producer.edibles()
- Producer.products()
- Producer.availability()
- Dispensary.all()
- Dispensary.dispensary()
- Dispensary.strains()
- Dispensary.extracts()
- Dispensary.edibles()
- Dispensary.products()
returns an Array of strain objects.
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated recordsname
- Alphabetically stating with numeric strains. 0-9, A-Z.-name
- Alphabetically starting with Z and working back through numeric strains. Z-A, 9-0.
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Strain
.all(options)
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Strain
.search('orange')
.then(data => console.log(data))
.catch(err => console.log(err))
Strain
.strain('VUJCJ4TYMG000000000000000')
.then(data => console.log(data))
.catch(err => console.log(err))
Strain
.strain('VUJCJ4TYMG000000000000000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Strain
.reviews('VUJCJ4TYMG000000000000000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
Strain
.effectsFlavors('VUJCJ4TYMG000000000000000')
.then(data => console.log(data))
.catch(err => console.log(err))
Strain
.seedCompany('VUJCJ4TYMG000000000000000')
.then(data => console.log(data))
.catch(err => console.log(err))
Strain
.genetics('VUJCJ4TYMG000000000000000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Strain
.children('VUJCJ4TYMG000000000000000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.radius
- [Number] Radius to search for in miles, max 25.
Strain
.availability('VUJCJ4TYMG000000000000000', 37.7749295, -122.4194155, options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Flower
.all(options)
.then(data => console.log(data))
.catch(err => console.log(err))
flowers
seeds
clones
shake
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Flower
.type(flowerType, options)
.then(data => console.log(data))
.catch(err => console.log(err))
Flower
.flower('AHZ7H4N6467FVUDY3DAY00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Flower
.user('AHZ7H4N6467FVUDY3DAY00000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Flower
.reviews('AHZ7H4N6467FVUDY3DAY00000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
Flower
.effectsFlavors('AHZ7H4N6467FVUDY3DAY00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Flower
.producer('AHZ7H4N6467FVUDY3DAY00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Flower
.strain('AHZ7H4N6467FVUDY3DAY00000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.radius
- [Number] Radius to search for in miles, max 25.
Flower
.availability('AHZ7H4N6467FVUDY3DAY00000', 37.7749295, -122.4194155, options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Extract
.all(options)
.then(data => console.log(data))
.catch(err => console.log(err))
kief
hash
water-hash
oil
wax
crumble
honeycomb
shatter
vaporizer-disposable
vaporizer-cartridge
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Extract
.type(extractType, options)
.then(data => console.log(data))
.catch(err => console.log(err))
Extract
.extract('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Extract
.user('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Extract
.reviews('3CV7E33XLHTJT2XZ4GMD00000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
Extract
.effectsFlavors('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Extract
.producer('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Extract
.strain('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.radius
- [Number] Radius to search for in miles, max 25.
Extract
.availability('3CV7E33XLHTJT2XZ4GMD00000', 37.7749295, -122.4194155, options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Edible
.all(options)
.then(data => console.log(data))
.catch(err => console.log(err))
baked goods
candy
treat
chocolate
snack
beverage
pill
tincture
butter
honey
breath strips
tea
ice cream
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Edible
.type(edibleType, options)
.then(data => console.log(data))
.catch(err => console.log(err))
Edible
.edible('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Edible
.user('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Edible
.reviews('3CV7E33XLHTJT2XZ4GMD00000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
Edible
.effectsFlavors('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Edible
.producer('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Edible
.strain('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.radius
- [Number] Radius to search for in miles, max 25.
Edible
.availability('3CV7E33XLHTJT2XZ4GMD00000', 37.7749295, -122.4194155, options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Product
.all(options)
.then(data => console.log(data))
.catch(err => console.log(err))
bath
topical
skin care
pre-roll
lip balm
massage oil
personal lubricant
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Product
.type(productType, options)
.then(data => console.log(data))
.catch(err => console.log(err))
Product
.product('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Product
.user('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Product
.reviews('3CV7E33XLHTJT2XZ4GMD00000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
Product
.effectsFlavors('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Product
.producer('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
Product
.strain('3CV7E33XLHTJT2XZ4GMD00000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.radius
- [Number] Radius to search for in miles, max 25.
Product
.availability('3CV7E33XLHTJT2XZ4GMD00000', 37.7749295, -122.4194155, options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated recordsname
- Alphabetically stating with numeric producers. 0-9, A-Z.-name
- Alphabetically starting with Z and working back through numeric producers. Z-A, 9-0.
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Producer
.all(options)
.then(data => console.log(data))
.catch(err => console.log(err))
Producer
.producer('0000000000L6M7E0000000000')
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
Producer
.extracts('0000000000L6M7E0000000000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
Producer
.edibles('0000000000L6M7E0000000000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
Producer
.products('0000000000L6M7E0000000000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.radius
- [Number] Radius to search for in miles, max 25.
Producer
.availability('0000000000L6M7E0000000000', 37.7749295, -122.4194155, options)
.then(data => console.log(data))
.catch(err => console.log(err))
Product
.seedCompany('VUJCJ00000000000000000000')
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
SeedCompany
.seedCompany('VUJCJ00000000000000000000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
SeedCompany
.reviews('VUJCJ00000000000000000000', options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated recordsname
- Alphabetically stating with numeric strains. 0-9, A-Z.-name
- Alphabetically starting with Z and working back through numeric strains. Z-A, 9-0.
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Dispensary
.all(options)
.then(data => console.log(data))
.catch(err => console.log(err))
Dispensary
.dispensary('ca', 'san-francisco', 'grass-roots')
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Dispensary
.strains('ca', 'san-francisco', 'grass-roots', options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Dispensary
.extracts('ca', 'san-francisco', 'grass-roots', options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Dispensary
.edibles('ca', 'san-francisco', 'grass-roots', options)
.then(data => console.log(data))
.catch(err => console.log(err))
sort
- [String] Possible values:createdAt
- Oldest records-createdAt
- Newest recordsupdatedAt
- Oldest updated records-updatedAt
- Newest updated records
page
- [Number] By default, Cannabis Reports will return 10 records at a time for this API call. You can use thepage
argument to fetch the page of results you want. Check out the pagination section of the documentation for further information.
Dispensary
.products('ca', 'san-francisco', 'grass-roots', options)
.then(data => console.log(data))
.catch(err => console.log(err))