Hands On

Finding COVID-19 Testing Sites with the HERE Geocoding and Search API

By Raymond Camden | 09 June 2020

A few days ago we added new support for finding COVID-19 testing sites using our Geocoding and Search API. This is a crucial update to help people build solutions to connect users to testing locations. In this post I'm going to quickly describe how to access this new data. Note that you'll need a freemium HERE developer in order to use this API.

This new support works with both our Dicover and Browse endpoints. If you remember, "Discover" is better suited for text based searches across multiple categories whereas "Browse" is better suited for searching within specific categories. There's definitely a bit of overlap there but you can decide which is the best for your needs.

To return testing sites, you must search for the string, "COVID" (case does not matter). Doing so will returns results where each place name will be prefixed with "Covid-19 Testing Site:". Here's an example doing a search local to Lafayette, LA:

https://discover.search.hereapi.com/v1/discover?apikey={{apiKey}}&q=Covid&at=30.22,-92.02&limit=10

And here's the result (reduced down to three results):

{
    "items": [
        {
            "title": "Covid-19 Testing Site: Cajundome & Convention Center",
            "id": "here:pds:place:8409vqec-b18ef0a254f64cb8843d6bd84895917d",
            "resultType": "place",
            "address": {
                "label": "Covid-19 Testing Site: Cajundome & Convention Center, 444 Cajundome Blvd, Lafayette, LA 70506-4264, United States",
                "countryCode": "USA",
                "countryName": "United States",
                "state": "Louisiana",
                "county": "Lafayette",
                "city": "Lafayette",
                "street": "Cajundome Blvd",
                "postalCode": "70506-4264",
                "houseNumber": "444"
            },
            "position": {
                "lat": 30.21844,
                "lng": -92.03887
            },
            "access": [
                {
                    "lat": 30.21757,
                    "lng": -92.04011
                }
            ],
            "distance": 1821,
            "categories": [
                {
                    "id": "800-8000-0400"
                }
            ],
            "contacts": [
                {
                    "phone": [
                        {
                            "value": "+13372652100"
                        }
                    ],
                    "www": [
                        {
                            "value": "http://ldh.la.gov/"
                        }
                    ]
                }
            ]
        },
        {
            "title": "Covid-19 Testing Site: Northside Community Health Center",
            "id": "here:pds:place:8409vqs4-661e7d098a944604bdc181f41d5dceb6",
            "resultType": "place",
            "address": {
                "label": "Covid-19 Testing Site: Northside Community Health Center, 1800 Louisiana Ave, Lafayette, LA 70501-3702, United States",
                "countryCode": "USA",
                "countryName": "United States",
                "state": "Louisiana",
                "county": "Lafayette",
                "city": "Lafayette",
                "street": "Louisiana Ave",
                "postalCode": "70501-3702",
                "houseNumber": "1800"
            },
            "position": {
                "lat": 30.24118,
                "lng": -92.00064
            },
            "access": [
                {
                    "lat": 30.24123,
                    "lng": -92.00093
                }
            ],
            "distance": 3001,
            "categories": [
                {
                    "id": "800-8000-0400"
                }
            ],
            "contacts": [
                {
                    "phone": [
                        {
                            "value": "+13376789000"
                        }
                    ],
                    "www": [
                        {
                            "value": "http://ldh.la.gov/"
                        }
                    ]
                }
            ]
        },
        {
            "title": "Covid-19 Testing Site: Clark Integrated Medical Clinic",
            "id": "here:pds:place:8409vqef-f61ea5135b314808bad8a933683273a9",
            "resultType": "place",
            "address": {
                "label": "Covid-19 Testing Site: Clark Integrated Medical Clinic, 130 Rue Beauregard, Lafayette, LA 70508-3102, United States",
                "countryCode": "USA",
                "countryName": "United States",
                "state": "Louisiana",
                "county": "Lafayette",
                "city": "Lafayette",
                "street": "Rue Beauregard",
                "postalCode": "70508-3102",
                "houseNumber": "130"
            },
            "position": {
                "lat": 30.19261,
                "lng": -92.01253
            },
            "access": [
                {
                    "lat": 30.19276,
                    "lng": -92.01236
                }
            ],
            "distance": 3129,
            "categories": [
                {
                    "id": "800-8000-0400"
                }
            ],
            "contacts": [
                {
                    "phone": [
                        {
                            "value": "+13372323353"
                        }
                    ],
                    "www": [
                        {
                            "value": "http://ldh.la.gov/"
                        }
                    ]
                }
            ]
        }
    ]
}

This also works with the Browse endpoint, but note that at the time of this article's publication, it will not work with category filters. Be sure to leave the value off of your API calls:

https://browse.search.hereapi.com/v1/browse?apiKey={{apiKey}}&at=30.22,-92.02&name=Covid&limit=10

Of course you will get category values in your results so a secondary filter operation could be performed there. (This issue will be corrected soon.)

As always, we are adapting as fast as possible to changing situations. We sincerely hope this helps and if you need support, do not forget you can find us on StackOverflow and Slack.