Skip to main content
HomeAbout PythonLearn Python

MeetUp API

In this tutorial, you’ll learn how to pull data directly from MeetUp’s API using Python and write it into a JSON.
Aug 2018  · 8 min read

MeetUp is a social media website that allows members to form virtual communities that organize events in their local geographic area. The concept MeetUp has had isn't new, but the UI and UX has been the most innovative in recent years. Streamlining the tasks of organizing events specific to a community that meet daily, weekly, monthly or bi-monthly has been made easier.

MeetUp's API allows for users to collect data from the website directly. Like most API's, many domain owners limit the amount of data you can call. Some domains don't do an excellent job at maintaining the documentation of their API. Some do amazing work with making their documentation as user friendly as possible. MeetUp is somewhere in the middle. There are many ways you can use their API.

My use of MeetUp's API was to collect data from three different groups within the Dallas-Fort Worth area in North Texas. The language I used to access the API on MeetUp's domain was Python. Depending on what you're comfortable with, C++ or Python can be sufficient in using a website's API.

If you're not familiar with Python yet, be sure to take a look at our Intro to Python for Data Science course.

In this tutorial, you will learn how to call MeetUp's API using Python. I will show how you can obtain a group’s ID, and how you can use that ID with your API Key to make a Request for a group's data in JSON format. Finally, I will demonstrate how you can write the captured data into a JSON file that will save on your PC/Mac.

How do you obtain an API Key?

On MeetUp’s website, you must have an active account to obtain an API key. All users on the website are given a key. For those of us without an account, the first step is to sign up for an account on MeetUp. Once completed you can obtain your API key here.

You have the option to reset your key at any time. It is important that you keep your API key confidential.

Getting started

First, you want to import all Python libraries that will be used in your simple py script.

import meetup.api
import json
import requests
import time
import codecs
import sys
import io

Installing the API

Make sure meetup.api is installed on your machine before proceeding with running this input. A simple pip install is all that's needed, if you're using a UNIX based command prompt as followed:

pip install meetup.api

If using Jupyter Notebooks you can install the library as follows:

!pip install meetup.api

This will install MeetUp’s API library for Python.

Since Python is an interpretative language, defining plays an important role in the syntax. For example, by defining client you can now write any requests and simply use the term client to call the API key, therefore having no need to continuously retype the API Key. This is an important aspect of coding with Python. First, you will define your API key as client as followed:

client = meetup.api.Client('API Key Here')

Defining group_info allows you to pull a group's url based upon the group's name on MeetUp's website.

group_info = client.GetGroup({'urlname': 'Group Name Here No Spaces'})

Getting a group's ID

Once this is done, you can now call group_info, and make several requests with it. By typing the line the output will be the group's complete URL address.

Calling in the next line will get you the group's ID number.

you want the Group's ID number to be able to move forward with the next step.

Making requests

Now you know your group's ID number. You can pull the request by defining df and insert your group id and API key into the url. This is called a request.get

df = requests.get('')

With df defined, you can now call the status_code, headers, encoding, and you can directly view the data by calling the json.

First, you will type df.status_code, the output for the status_code should be: 200

For the headers you type df.headers['content-type'] Output for headers: application/json;charset=utf-8

To check your encoding type df.encoding Output for encoding: utf-8

At this point, your data defined as df exists. To look at it inline type df.json()

Writing the data to a JSON file

You have the data at this point. Next, you will write the data into a json file that saves onto your PC/MAC. This is an important step. You already have the data, but it's not saved on your local hard-drive. You can use the following code to write the data into a file.

 to_unicode = unicode
except NameError:
 to_unicode = str
with'df.json', 'w', encoding='utf8') as outfile:
 str_ = json.dumps(data,
 indent=4, sort_keys=True,
 separators=(',', ': '), ensure_ascii=False)

Before running this, import the io library by running import io.

The moment you run this code, it will write the data from the Request pull you made using MeetUp's API into a JSON file saved onto your hard-drive directory. Specifically located in the same directory as the .ipynb or .pyfile you’re using.

If you’re using Jupyter Notebook, you should be able to find it immediately if you organize your directory on Jupyter Notebook in order of last modified. Feel free to save it into a more convenient location for future use.

What are the uses from the JSON file? The JSON file holds the data you pulled using MeetUp’s API. You can use this data in a variety of ways. If the data has missing values, you can use Python to clean the data. You can build a dataset and apply numerous techniques to engage in Data Analysis. Or you can visualize the data and build dashboards and graphs showing correlations within the dataset. Finally, a good dataset can be used to apply Machine Learning algorithms to build a predictive model. These are some of the few things you can use the JSON file we’ve written from MeetUp’s API. Your only limitation is your imagination. In conclusion, pulling data from a website’s API is one of many ways to obtain datasets. The end goal is to put the dataset to good use in data analysis, modelling, and visualization.


To conclude, using MeetUp's API to pull data takes several steps. The first step is to find and identify your API Key, the next step is to get the desired group's ID. With this information you can pull data from any group you like. Once the pull request is made, you will need to write it into a JSON file. Knowing how to use APIs as a tool is a useful and cost effective way to collect data. You're collecting data that you can work with on future projects. Using a website's API is often the most non-intrusive methodology when compared to other methods such as data scrapping. Once you have a JSON file, there is also still work to be done with it. You will still need to clean the data. As a beginner you will need to understand the term cleaning data. Cleaning data is when you organize a dataset so that the columns and rows of a dataset isn't missing. You will look at missing numerical data and categorical data (names, locations, etc). You now have the tools to start pulling data from MeetUp's API.

Before you can start working with data requested from an API, you will have to clean the data. If you would like to learn how, be sure to take our Cleaning Data in Python course.

When using a website's API, please be aware of the limitations placed on the use of an API. Domain Owners set these rules themselves. Practice self-awareness and be conscientious.

Check out our Beginner's Guide to Google's Vision API in Python tutorial.

Python Courses

Introduction to Python

4 hr
Master the basics of data analysis with Python in just four hours. This online course will introduce the Python interface and explore popular packages.
See DetailsRight Arrow
Start Course
See MoreRight Arrow

Pandas 2.0: What’s New and Top Tips

Dive into pandas 2.0, the latest update of the essential data analysis library, with new features like PyArrow integration, nullable data types, and non-nanosecond datetime resolution for better performance and efficiency.
Moez Ali's photo

Moez Ali

9 min

PyTorch 2.0 is Here: Everything We Know

Explore the latest release of PyTorch, which is faster, more Pythonic, and more dynamic.
Abid Ali Awan's photo

Abid Ali Awan

6 min

An Introduction to Python T-Tests

Learn how to perform t-tests in Python with this tutorial. Understand the different types of t-tests - one-sample test, two-sample test, paired t-test, and Welch’s test, and when to use them.
Vidhi Chugh's photo

Vidhi Chugh

13 min

Matplotlib time series line plot

This tutorial explores how to create and customize time series line plots in matplotlib.
Elena Kosourova's photo

Elena Kosourova

8 min

Step-by-Step Guide to Making Map in Python using Plotly Library

Make your data stand out with stunning maps created with Plotly in Python
Moez Ali's photo

Moez Ali

7 min

High Performance Data Manipulation in Python: pandas 2.0 vs. polars

Discover the main differences between Python’s pandas and polars libraries for data science
Javier Canales Luna's photo

Javier Canales Luna

16 min

See MoreSee More