This project consists of Python scripts to automate the process of exporting saved lists from Foursquare and importing them into Google Maps. It uses Foursquare's API to extract lists and Selenium to interact with Google Maps.
- Export Foursquare Lists: Extract all saved lists and their associated locations from Foursquare.
- Upload to Google Maps: Automatically create Google Maps lists and add places from Foursquare.
- Error Handling: Includes basic retry mechanisms and logs to track progress.
- CSV Export: Export the place data for further analysis.
- Python: Ensure Python 3.7 or higher is installed.
- Google Chrome: Latest version of Google Chrome is required.
- ChromeDriver: Install the appropriate version of ChromeDriver matching your Google Chrome version.
- Foursquare Access Token: Obtain an access token from Foursquare Studio (Instructions).
-
Clone this repository:
git clone https://github.com/yourusername/foursquare-to-google-maps.git cd foursquare-to-google-maps
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the root directory and add the following variables:FSQACCESS_TOKEN=your_foursquare_access_token USER_DIR=path_to_chrome_user_data_directory
FSQACCESS_TOKEN
: Replaceyour_foursquare_access_token
with your actual token.USER_DIR
: Replacepath_to_chrome_user_data_directory
with the path to your Chrome user data directory for managing Google account sessions.
Run the getFSQList.py
script to export Foursquare lists and save them to a CSV file:
python getFSQList.py
This will generate a file named allplaces.csv
containing the exported data.
Run the FSQ-to-GMaps.py
script to create and populate Google Maps lists:
python FSQ-to-GMaps.py
This script will:
- Log into your Google account using the Chrome browser.
- Navigate to Google Maps lists and create new ones if needed.
- Add places to the lists from the CSV file.
- Use this script at your own risk. It will not delete any data from existing Google Maps lists but it may add a lot of entries there and sometimes it can add the wrong place.
- Sometimes Selenium throws an error when trying to click on a place in the search results dropdown. When that happens, the script will pause and give the user the opportunity to click on the correct entry (in the Chrome window). To continue, press any key in the terminal window where the script is running.
- I consider this an alpha version; any comments and contributions would be really welcome.
- getFSQList.py: Extracts saved lists from Foursquare and saves them as a CSV file.
- FSQ-to-GMaps.py: Reads the CSV file and automates the creation and population of Google Maps lists.
- processCSV.py: handles reading and writing CSV files.
- requirements.txt: Lists all required Python dependencies.
- .env: Configuration file for sensitive information (not included in the repository).
- Selenium: Automates interaction with Google Maps.
- Requests: Handles API requests to Foursquare.
- Colorama: Adds colored console output for better visibility.
- RapidFuzz: Provides string matching and similarity scoring.
- python-dotenv: Loads environment variables from a
.env
file.
- Ensure that you are logged into your Google account in the specified Chrome user profile (
USER_DIR
) before running the scripts. - Use the Foursquare token responsibly, as misuse may lead to rate limiting or account suspension.
- Some places may not be found in Google Maps due to differences in naming or address formats.
This project is licensed under the CC0 License. See the ofile for more details.
- Foursquare API for providing access to saved lists.
- Selenium for browser automation.