Leafly API Documentation
At Leafly, our goal is to make the API so simple, even a stoner like yourself can use it! All data is sent as JSON and there are only a couple important methods you need to know about.
1) List Strains
Use this to get an overview of all strains we have available on the site. Certain filters can be applied to limit what is returned to you.
Url: http://www.leafly.com/api/strains
Sample Data
[{
"Key":"afghan-kush",
"Name":"Afghan Kush",
"Category":"Indica",
"Symbol":"Afg",
"Abstract":"Originating from the Hindu Kush mountains of Afghanistan...",
"Url":"http://www.leafly.com/indica/afghan-kush",
"DetailUrl":"http://www.leafly.com/api/details/afghan-kush",
"Rating":8,
"TopEffect":"Lazy",
"TopMedical":"Migraines",
"TopActivity":"Relax at home"},
{
"Key":"ak-47",
"Name":"AK-47",
"Category":"Hybrid",
"Symbol":"Ak",
"Abstract":"A great afghani kush cannabis strain that is mostly sativa...",
"Url":"http://www.leafly.com/hybrid/ak-47",
"DetailUrl":,"http://www.leafly.com/api/details/ak-47
"Rating":7,
"TopEffect":"Lazy",
"TopMedical":"Migraines",
"TopActivity":"Relax at home"
}]
Optional Parameters
category
Filter returned strains by specified category. Valid categories are: hybrid, indica, sativa.
Example: http://www.leafly.com/api/strains?category=hybrid
jsoncallback
The jsoncallback parameter wraps the JSON output text in parentheses and a function name of your choosing.
Example: http://www.leafly.com/api/strains?jsoncallback=myFunction
2) Strain Details
This method returns details for a specific strain that you request.
Url: http://www.leafly.com/api/details/[key]
Sample Data
{
"Key":"ak-47",
"Name":"AK-47",
"Category":"Hybrid",
"Symbol":"Ak",
"Abstract":"A great afghani kush cannabis strain that is mostly sativa...",
"Overview":"Don\u0027t let the scary name fool you, AK-47 will leave you relaxed and mellow...",
"Url":"http://www.leafly.com/hybrid/ak-47",
"Rating":7,
"TopEffect":"Lazy",
"TopMedical":"Migraines",
"TopActivity":"Relax at home",
"Reviews":[{"DateAdded":"\/Date(1276224030117)\/",
"BuzzLength":88,
"Rating":7,
"Notes":"AK-47 is one of my all-time favorites..."
}, {...}]
}
Optional Parameters
jsoncallback
The jsoncallback parameter wraps the JSON output text in parentheses and a function name of your choosing.
Example: http://www.leafly.com/api/details/white-widow?jsoncallback=myFunction
