<jupyter_start><jupyter_text>Find Meijer store locations.Use the Meijer API to return a list of all stores.  Lessons Learned.- Using [Fake GPS location](https://play.google.com/store/apps/details?id=com.lexa.fakegps&hl=en_US) Meijer's app searches for location (0.0, 0.0).- API URL: https://mservices.meijer.com/storeinfo/api/mobile/near?latitude=0.0&longitude=0.0&miles=2000&numToReturn=250 Fred Meijer Offices:2929 Walker Ave NW, Grand Rapids, MI 4954443.016570, -85.726290<jupyter_code>latitude, longitude=43.016570, -85.726290
account_services_secret="drAqas76Re7RekeBanaMaNEMah7paDE5"
basic_token=base64.encodebytes("mma:{}".format(account_services_secret).encode("UTF-8")).decode("UTF-8").strip()


url = 'https://mservices.meijer.com/storeinfo/api/mobile/near'
payload = {
    'latitude': latitude,
    'longitude': longitude,
    'miles': '10000',
    'numToReturn': '10000',
}
r = requests.get(url, params=payload)
r<jupyter_output><empty_output><jupyter_text>Digging through the sniffed traffic there's an extra 'authorization header'<jupyter_code>import os
os.environ["MEIJER_AUTH"]="Bearer ..."
headers = {
    "Authorization": os.environ["MEIJER_AUTH"],
    "Version": "6",
    "User-Agent": "okhttp/3.8.0",
}
url = 'https://mservices.meijer.com/storeinfo/api/mobile/near'
payload = {
    'latitude': Latitude,
    'longitude': Longitude,
    'miles': '10000',
    'numToReturn': '10000',
}
r = requests.get(url, params=payload, headers=headers)
r.status_code
len(r.json()["store"])<jupyter_output><empty_output><jupyter_text>From Wiki: https://en.wikipedia.org/wiki/Meijer.> About half of the company's **242 stores** are located in Michigan, with additional locations in Illinois, Indiana, Kentucky, Ohio, and Wisconsin.<jupyter_code>(r.json()).keys()
import json
stores = r.json()["store"]
stores
with open("meijer_stores.json", "w") as fid:
    json.dump(stores, fid)
with open("meijer_stores.json", "r") as fid:
    stores2 = json.load(fid)
stores2<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup