The task at hand was finding an API for one of our clients that could provide a comprehensive list of their clients stores. The goal was to cross-reference this with our database, ensuring each store was accounted for. Despite my efforts, the search came up empty. However, their website presented an intriguing alternative: a detailed directory segmented by state and country.
My initial approach was to examine the website's HTML, yet this only yielded the default data. Attempts to append the URL to load data from different countries proved futile. The website's dropdown appeared to use JavaScript to pull varying data sets. My initial assumption was that each selection triggered a new query. However, upon closer inspection, I discovered a JSON object nestled just before the closing body tag. Rather than querying anew each time, the JavaScript simply drew from different arrays within this pre-loaded object.
Enter ChatGPT, OpenAI's conversational AI.