The Meetup API provides simple RESTful HTTP and streaming interfaces for extending your community using the Meetup platform from your own apps.
Get questions answered on the API mailing list.
The API is a set of core methods and a common request format. These are combined to form a URL that returns the information you want. Here's an example of an API call that lists parenting groups near Williamsburg, Brooklyn.
https://api.meetup.com1/find/groups2?zip=11211&radius=1&category=253&order=members4
In addition, you can specify these parameters for more control:
Most requests must be authenticated. Unless otherwise specified, response payloads are returned in JSON format. Details on the formats, parameters and ordering accepted by each method are listed below.
The Meetup API supports the CORS specification which allows browser clients hosted on a domain other than api.meetup.com to communicate directly with the API.
The API uses OAuth consumer redirect uris to validate a request's origin, so you must be using OAuth to benefit from CORS. The suggested OAuth authorization scheme is the OAuth2 Implicit flow, which is tailored for browsers. Once a browser client receives authorization and issues an HTTP request, the Meetup API will validate the request's Origin header with the consumers registered redirect URI in addition to the HTTP method used for the given API endpoint.
You can inspect which HTTP methods an API method supports issuing an OPTIONS request for the given method uri and origin. An example of the response headers is below.
curl -i \
-X OPTIONS \
-H 'Origin: http://consumerhost.com' \
'https://api.meetup.com/2/member/self?access_token=TOKEN'
HTTP/1.1 200 OK
Access-Control-Expose-Headers: X-Meetup-server, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimt-Reset
Access-Control-Allow-Origin: http://consumerhost.com
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Max-Age: 86400
The CORS specification is relatively new, but many browsers have already adopted it. You can find the current browser support here here.
Each API method has multiple ways you can request the data be returned as. All methods support json, and this is the default format used when you don't explicitly supply one. The other formats are supported when it makes sense for the type of data being requested.
JSON JavaScript Object Notation. Learn more here.
XML A simple XML format with the exact same fields as the JSON response.
KML Keyhole markup language. Learn more here.
RSS RSS 2.0. Learn more here.
ATOM Learn more here.
If you request json, and want to play with the API in a web browser -- callbacks are useful. Specifying a callback will allow you to populate sample data using a <script/> tag by returning javascript that calls the function you provide as a query parameter.
https://api.meetup.com/topics.json?callback=gotIt&page=1
gotIt({"results":[...], "meta": {...}})
The content of a successful response to a query depends on the format it was requested in. Below is an example of a JSON payload
curl -H "Authorization: Bearer {access_token}" "https://api.meetup.com/topics?page=1"
{
"results" : [ {
"urlkey" : "social",
"members" : "10981303",
"link" : "http://social.meetup.com/",
"name" : "Social",
"description" : "Meet and hang out with other social people just like you! Let's socialize!",
"id" : "10581",
"updated" : "Tue Aug 12 09:16:02 EDT 2008"
} ],
"meta" : {
"next" : "https://api.meetup.com/topics?offset=1&format=json&page=1&order=members",
"method" : "Topics",
"total_count" : 140666,
"link" : "https://api.meetup.com/topics",
"count" : 1,
"description" : "API method for accessing meetup topics",
"lon" : "",
"title" : "Meetup Topics",
"url" : "https://api.meetup.com/topics?offset=0&format=json&page=1&order=members",
"id" : "",
"updated" : "Tue Dec 02 16:00:17 EST 2014",
"lat" : ""
}
}
As newer methods are introduced as part of the v3 API, response bodies will be simplified into what would normally be returned in the results response property of previous API versions. Relevant request metadata, previously embedded in the meta response body field, will now be encoded has HTTP headers with the response. The prev and next meta fields will now be encoded in a Link header. Link types will be annotated with a "rel" attribute.
$ curl -H "Authorization: Bearer {access_token}" -i "https://api.meetup.com/find/groups?zip=10021"
HTTP/1.1 200 OK
...
Link: <https://api.meetup.com/find/groups?zip=10021&page=200&offset=1>; rel="next"
X-Total-Count: 10171
...
[{...}]
Clients that wish to access the API using JSONP will not be able to access the headers mentioned above. When supplying a JSONP callback, these headers will be encoded with the body of the response in the following format.
$ curl -H "Authorization: Bearer {access_token}" 'https://api.meetup.com/find/groups?callback=foo&zip=10021'
foo({
"meta": {
"next_link":"https://api.meetup.com/find/groups/?callback=foo&page=200&zip=10021&offset=1",
"total_count": 10171,
// other headers
},
"data": // contents of the normal response
)
Note that the links from the Link header will be render with JSON keys in the form "{rel}_link".
The results entity contains a list of the items that match the query criteria. Result fields are named values in these items, including simple values like strings and numbers, as well as entities that have values nested inside.
Many API methods support optional result fields, as indicated in their documentation. One or more optional fields may be requested with the fields parameter, with names separated by commas. Since optional fields generally increase the processing time for a request, they should be requested only when needed.
https://api.meetup.com/recommended/groups?zip=10021&fields=join_info
Result filters reduce the size of API responses. You can suppress result fields by specifying only and/or omit parameters. With only you will retrieve only those fields specified, and with omit you will retrieve all default fields excluding those specified.
The values of the only and omit parameters must be a comma-delimited list of fully qualified fields. You can specify nested sub-fields using periods. Both filters may be provided in the same request. See the examples below.
Search topics for "tech", but only include each topic's id and name (try in API Console):
https://api.meetup.com/topics?search=tech&only=id,name
Query for an event's hosting group information, returning only the group's id and topics, but don't return the urlkey nested in each topic:
https://api.meetup.com/2/events?event_id=someid&only=group.id,group.topics&omit=group.topics.urlkey
Note that this feature is only available for json and xml formats.
Many of the query methods in the API require a member_id field for filtering. Sometimes you may want that member_id to be the id of the member owning the API key or who authorized an oauth token. To remove the need for an extra query to access that member_id, you may instead use the self alias in place of the member_id you would have to otherwise query for.
The following is an example of querying the /2/events method for your upcoming Meetup events.
curl 'https://api.meetup.com/2/events?member_id=self'
Try it yourself.
One notable change in the version 2 API methods is the consistency of event identifiers. In particular, recurring event identifiers. If you post an rsvp for a recurring event using its string identifier in the version 1 API, all future calls relating to that event, will return an the integer version of its identifier. In the version 2 API methods, any reference to a recurring event should retain the string version of its identifier. If you post an rsvp for a recurring event in the version 2 API, you should expect the string identifier to remain intact.
This entity, meta in JSON and head in XML, supplies information about the response. For query methods, it can be expanded with Geo IP information by specifying a value of geo_ip in the fields parameter.
count is the number of records returnedtotal count is the total number of records that match your criteriaupdated is the last time one of the items in the requesttitle, description some descriptive information about the requestnext if the total count is more than the count, this URL will request the next set of recordsurl the URL used to generate this requestmethod the API method calledgeo_ip approximate location of the requesting client, if geo_ip is specified in the fields parameter
latlonRSS, ATOM and KML topics don't return the meta information provided by the XML & JSON formats.
You can optionally supply request headers which give the API more context for the request.
You can supply the HTTP header X-Meta-Visit with a value of a valid Meetup group ID or X-Meta-Visit-Event with a value of a valid Meetup event ID. This will notify the API that your application has a context for a user visiting a group. Some API methods that perform an action that creates data like making and RSVP, posting an event comment and checking in do this implicitly. You can provide this request header to provide the same context when querying for data. Organizers on the site often check their member lists sorted by the last time a member visited their group. Using this header will allow this list to be more accurate.
The X-Meta-Request-Headers header can specify a comma-delimited list of API-specific X-Meetup response header names to include in the response. Currently the only supported header name is unread-notifications.
X-Meta-Request-Headers: unread-notificationsYou should receive a response header named
X-Meetup-Unread-Notifications whose value is the authenticated member's unread notification count.
The X-Meta-Photo-Host header can specify a value of secure to
have all photo links returned be hosted on a secure domain.
When everything goes well, we'll send a 200 response code along with your data. If there was a problem, you will receive a response with error details formatted in either XML or JSON, depending on which format was requested. Except for JSON callbacks as noted below, error responses will have one of the following HTTP status codes:
The 400 BadRequest response is something of a catch-all: sent if you have incorrect or missing parameters, if you exceed your API limits or you request an unsupported format. The response body will have more detail.
A typical version 3 error response body will be serialized as JSON list of error objects, each with a code, message, and optionally a field property.
{
"errors": [{
"code": "field_error",
"message": "field value was invalid",
"field": "field_name"
}, {
"code": "non_field_error",
"message": "other condition not met"
}]
}
JSON requests that specify a callback parameter are treated differently: the API always responds with an HTTP status of 200, so that a client browser will load the response and handle the callback. When an error occurs its corresponding status line is served in a "status" field of the error response object rather than in the response header.
The Meetup API aims to provide consistent responsiveness and equal quality of service for all its consumers. In order to do so, we limit the frequency at which the API will produce successful responses to a single client.
You can know your current rate limit status by reading X-RateLimit HTTP headers included in responses. The following table indicates their name and meaning.
| Header name | Meaning |
|---|---|
| X-RateLimit-Limit | The maximum number of requests that can be made in a window of time |
| X-RateLimit-Remaining | The remaining number of requests allowed in the current rate limit window |
| X-RateLimit-Reset | The number of seconds until the current rate limit window resets |
Clients that issue too many requests in a short period of time will receive a HTTP 429 error and an error message.
In the version 1 and 2 API methods you will receive a message in this form:
{
"details": "Credentials have been throttled",
"problem": "Client throttled",
"code": "throttled"
}
In the version 3 API methods you will receive a message in this form:
{
"errors":[{
"code": "throttled",
"message": "Credentials have been throttled"
}]
}
These responses indicate that you are making requests too quickly. If you receive one of these errors, you should adjust the frequency of your requests by adding a pause between them.
If you continue to issue requests at a frequency that triggers throttling responses, your credentials will be blocked for the remainder of the hour. You will know that your client is blocked when you receive a response with the error code "blocked".
In the version 1 and 2 API methods you will receive a message in this form:
{
"details": "Credentials have be throttled more than the allowed times in one hour",
"problem": "Client throttled",
"code": "blocked"
}
In the version 3 API methods you will receive a message in this form:
{
"errors":[{
"code": "blocked",
"message": "Credentials have been throttled more than the allowed times in one hour"
}]
}
Rather than issuing API requests until you are throttled and blocked, you will receive many more successful responses over time by tuning your client's request frequency such that it is not throttled at all.
The type of authentication used determines how requests are tallied. With OAuth-signed requests, it's the user that authorized the access token. For requests signed by or containing an API Key, the count is distinct to the key owner and the requesting IP address. These methods are designed to scale the rate up with an application's distributed userbase.
v3 comments