import requests
import json


def get_store_results(payload) -> list:
    """
    Request store results from Google Places API.

    :param payload: a dictionary of parameter required for the API request
    :precondition: the Google servers respond with either a properly formatted response or a faulty status code
    :postcondition: return an object as defined by the return statement below or raise an error as defined by the
    error statements below
    :raise ConnectionError: if the Google servers cannot be reached
    :return: data results as a dictionary
    """
    response = requests.get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?', params=payload)
    response.raise_for_status()
    if response.status_code != requests.codes.ok:
        raise ConnectionError("Server cannot be reached")
    data = json.loads(response.text)

    return data['results']