Scraping the ClassPass API
ClassPass has an excellent directory of fitness studios & gyms in its database. And because it’s a modern website, it’s easy to legally scrape using a little-known technique involving HAR files. This will record your web traffic as you browse data on ClassPass and then scrape the data from the recording instead of the actual website as to not violate the ClassPass Terms of Service.
1. Browse ClassPass Studios
Visit the ClassPass Search Feature and navigate or search for any local market you want to scrape the studios for. You can also apply any relevant filters you need.
Once the data is loaded in your browser, right click inside the browser and hit “Inspect” to open up developer tools. This will begin recording your web traffic so you can capture the raw data that ClassPass sends to your browser. Now refresh the page to reload the ClassPass search results into your browser now that you’re recording.
Browse around the map or paginate through pages of results. Whatever gets ClassPass to load more data while you’re recording will allow you to scrape more results.
2. Export a HAR File
Once you’ve browsed through all the ClassPass data you want to scrape, go to the “Network” tab in developer tools and click the down arrow labeled “Export HAR…” to download a HAR file containing all of the ClassPass studios in them.
To parse the HAR file, head to the HAR File Web Scraper and upload the file there. The tool will parse out relevant data and group together similar requests (so you can capture everything in one file).
3. Download ClassPass Studios
Click “Parse Group” on the relevant group from the previous step and you’ll be able to download the studio data as a CSV file you can then analyze in Excel or upload to your CRM or software of choice.