Skip to content

API is unable to fetch data by pincode #20

@babvin

Description

@babvin

from cowin_api import CoWinAPI

pin_code = ["570021","560066"]
date = '03-05-2021' # Optional. Default value is today's date
min_age_limit = 18 # Optional. By default returns centers without filtering by min_age_limit
for pin in pin_code:
cowin = CoWinAPI()
print(pin, type(pin))
try:
available_centers = cowin.get_availability_by_pincode(pin_code, date, min_age_limit)
print(available_centers)
except Exception as Error:
print("Error for pin,", pin, Error)

570021 <class 'str'>
Error for pin, 570021 'HTTPError' object has no attribute 'get'
560066 <class 'str'>
Error for pin, 560066 'HTTPError' object has no attribute 'get'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions