Plant Info Database is an API that will provide plant data for a vast amount of botanic species.

Here is a simply code that uses requests, json and webbrowser libraries harmoniously.

Code below demonstrates a simple access to using a Python code. You will need to replace your own token with the “XXXXX” parameters. You can register here for free to get a unique API key.

import requests
import json
import webbrowser

f = r""
def plants(f):
    paramss = {"token": "XXXXXXXXXXXXXXXXXXXXXXXX"}
    data = requests.get(f, params = paramss)
    tt = json.loads(data.text)
    return tt

a = plants(f)

for i in a:["link"]+"?token=XXXXXXXXXXXXXXXXXXXXXXX")


If you need a refresher on user defined functions lesson in Python here is a link to our Defining Functions Lesson.

Source of API:

Recommended Posts