You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何无需关键词/正则通过Meetup GraphQL API获取指定区域全部群组?

如何通过Meetup GraphQL API获取指定地理范围内的所有群组

Meetup的keywordSearch接口设计上确实依赖query参数,你用正则表达式没生效是因为这个接口并不支持正则匹配。要获取指定经纬度和半径内的所有群组,可以尝试以下两种方案:

方案1:使用空字符串作为query参数

部分场景下,将query设为空字符串可以匹配该地理范围内的所有群组,修改后的查询语句如下:

{
    keywordSearch(
        filter: {
            query: "", 
            lat: -35.2809368,
            lon: 149.1300092,
            radius: 62,
            source: GROUPS
        }
        input: {
            first: 200
        }
    ) {
    count
    pageInfo {
        endCursor
        hasNextPage
    }
    edges {
        node {
            id
            result {
                ... on Group {
                    id
                    name
                    urlname
                    country
                    description
                    topicCategory {
                        id
                        name
                    }
                }
            }
        }
    }
}

方案2:改用search接口(推荐)

Meetup GraphQL API提供了更通用的search接口,支持仅通过地理条件过滤群组,无需指定关键词:

{
  search(
    input: {
      first: 200,
      filters: {
        geo: {
          lat: -35.2809368,
          lon: 149.1300092,
          radius: 62
        },
        types: [GROUP]
      }
    }
  ) {
    count
    pageInfo {
      endCursor
      hasNextPage
    }
    edges {
      node {
        ... on Group {
          id
          name
          urlname
          country
          description
          topicCategory {
            id
            name
          }
        }
      }
    }
  }
}

注意事项

  • 处理分页:通过pageInfo中的hasNextPage和endCursor循环请求,获取所有结果(单次请求最多返回200条)
  • 权限验证:确保你的API密钥拥有访问群组数据的权限
  • 速率限制:Meetup API存在调用频率限制,避免短时间内发起过多请求

内容的提问来源于stack exchange,提问作者Naajid Sarosh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 12:21:03