关于使用Meetup.com GraphQL API获取附近活动的技术咨询
Hey Hassanjava! I’ve worked with the Meetup GraphQL API before, so let’s figure out how to pull nearby events without relying on a specific search keyword.
Your current keywordSearch query works well for targeted searches, but to get all events near your coordinates, you can tweak the filter by either omitting the query parameter entirely or setting it to an empty string. The API will then ignore the keyword filter and only use your latitude, longitude, and radius to return relevant results.
Here’s the adjusted query you can use:
query { keywordSearch(filter: { lat: 57.10557, lon: 12.25078, radius: 100, source: EVENTS }) { count edges { cursor node { id result { ... on Event { title eventUrl description dateTime going shortDescription } } } } } }
If the API enforces the query parameter (some endpoints require it even for broad searches), you can set it to an empty string instead:
query { keywordSearch(filter: { query: "", lat: 57.10557, lon: 12.25078, radius: 100, source: EVENTS }) { count edges { cursor node { id result { ... on Event { title eventUrl description dateTime going shortDescription } } } } } }
A few quick tips to keep in mind:
- Double-check the
radiusunit: Meetup’s API typically uses miles for radius values. If you need kilometers, convert your number first (100 miles ≈ 160 km). - Ensure your API credentials have permission to access public event data—some restricted groups won’t show up unless you’re a member.
- If
keywordSearchgives you trouble, check if theexploreEventsendpoint is available in your API version; it’s designed for location-based event discovery without keywords.
Hopefully this gets you the nearby events you’re looking for!
备注:内容来源于stack exchange,提问作者Hassanjava

