Created
September 1, 2018 21:41
-
-
Save mclarty/b81cb1bee8b021005dd2b56450f1ac4a to your computer and use it in GitHub Desktop.
Download CAPWATCH database via API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = "https://www.capnhq.gov/CAP.CapWatchAPI.Web/api/cw" | |
orgID = "{{orgID}}" # 362 = TXWG | |
unitOnly = "{{unitOnly}}" # 0 = No; 1 = Yes | |
user = "{{eServices username}}" | |
pwd = "{{eServices password}}" | |
payload = {'orgid': orgID, 'unitonly': unitOnly} | |
r = requests.get(url, params=payload, auth=(user, pwd)) | |
open('capwatch.zip', 'wb').write(r.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment