1.1.9 • Published 7 years ago

cannabis-reports v1.1.9

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Cannabis Reports

A Cannabis Reports API wrapper for Node.js

Build Status

This project uses modern ES2016+ syntax, which means you can use promises (as shown in the documentation) or async/await.

Installation

npm install --save cannabis-reports

Usage

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>')

Strains

Flowers

Extracts

Edibles

Products

Producers

Dispensaries

Seed Companies


options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - Oldest updated records -updatedAt - Newest updated records name - 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 the page 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))
query (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
ucpc (required) - String
Strain
  .strain('VUJCJ4TYMG000000000000000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Strain
  .strain('VUJCJ4TYMG000000000000000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
ucpc (required) - String
Strain
  .effectsFlavors('VUJCJ4TYMG000000000000000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Strain
  .seedCompany('VUJCJ4TYMG000000000000000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Strain
  .genetics('VUJCJ4TYMG000000000000000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
ucpc (required) - String
lat (required) - String or Number
lng (required) - String or Number
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
flowerType (required) - String Possible values:
  • flowers
  • seeds
  • clones
  • shake
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
ucpc (required) - String
Flower
  .flower('AHZ7H4N6467FVUDY3DAY00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Flower
  .user('AHZ7H4N6467FVUDY3DAY00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
ucpc (required) - String
Flower
  .effectsFlavors('AHZ7H4N6467FVUDY3DAY00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Flower
  .producer('AHZ7H4N6467FVUDY3DAY00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Flower
  .strain('AHZ7H4N6467FVUDY3DAY00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
lat (required) - String or Number
lng (required) - String or Number
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
extractType (required) - String Possible values:
  • kief
  • hash
  • water-hash
  • oil
  • wax
  • crumble
  • honeycomb
  • shatter
  • vaporizer-disposable
  • vaporizer-cartridge
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
ucpc (required) - String
Extract
  .extract('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Extract
  .user('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
ucpc (required) - String
Extract
  .effectsFlavors('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Extract
  .producer('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Extract
  .strain('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
lat (required) - String or Number
lng (required) - String or Number
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
edibleType (required) - String Possible values:
  • baked goods
  • candy
  • treat
  • chocolate
  • snack
  • beverage
  • pill
  • tincture
  • butter
  • honey
  • breath strips
  • tea
  • ice cream
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
ucpc (required) - String
Edible
  .edible('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Edible
  .user('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
ucpc (required) - String
Edible
  .effectsFlavors('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Edible
  .producer('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Edible
  .strain('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
lat (required) - String or Number
lng (required) - String or Number
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
productType (required) - String Possible values:
  • bath
  • topical
  • skin care
  • pre-roll
  • lip balm
  • massage oil
  • personal lubricant
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
ucpc (required) - String
Product
  .product('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Product
  .user('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
ucpc (required) - String
Product
  .effectsFlavors('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Product
  .producer('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
Product
  .strain('3CV7E33XLHTJT2XZ4GMD00000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
lat (required) - String or Number
lng (required) - String or Number
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - Oldest updated records -updatedAt - Newest updated records name - 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 the page 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))
ucpc (required) - String
Producer
  .producer('0000000000L6M7E0000000000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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 records updatedAt - Oldest updated records -updatedAt - Newest updated records
Producer
  .extracts('0000000000L6M7E0000000000', options)
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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 records updatedAt - Oldest updated records -updatedAt - Newest updated records
Producer
  .edibles('0000000000L6M7E0000000000', options)
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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 records updatedAt - Oldest updated records -updatedAt - Newest updated records
Producer
  .products('0000000000L6M7E0000000000', options)
  .then(data => console.log(data))
  .catch(err => console.log(err))
ucpc (required) - String
lat (required) - String or Number
lng (required) - String or Number
options (optional) - Object
  • page - Number By default, Cannabis Reports will return 10 records at a time for this API call. You can use the page 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))
ucpc (required) - String
Product
  .seedCompany('VUJCJ00000000000000000000')
  .then(data => console.log(data))
  .catch(err => console.log(err))
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - Oldest updated records -updatedAt - Newest updated records name - 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 the page 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))
state (required) - String Two character state for the dispensary.
city (required) - String City the dispensary is in (kebab-case).
slug (required) - String Slug for the name of the dispensary.
Dispensary
  .dispensary('ca', 'san-francisco', 'grass-roots')
  .then(data => console.log(data))
  .catch(err => console.log(err))
state (required) - String Two character state for the dispensary.
city (required) - String City the dispensary is in (kebab-case).
slug (required) - String Slug for the name of the dispensary.
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
state (required) - String Two character state for the dispensary.
city (required) - String City the dispensary is in (kebab-case).
slug (required) - String Slug for the name of the dispensary.
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
state (required) - String Two character state for the dispensary.
city (required) - String City the dispensary is in (kebab-case).
slug (required) - String Slug for the name of the dispensary.
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
state (required) - String Two character state for the dispensary.
city (required) - String City the dispensary is in (kebab-case).
slug (required) - String Slug for the name of the dispensary.
options (optional) - Object
  • sort - String Possible values: createdAt - Oldest records -createdAt - Newest records updatedAt - 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 the page 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))
1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.5

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago