> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapebadger.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Communities

> Search for Twitter communities by name, description, or keywords. Returns matching communities with comprehensive information including member count, join policy, and description. Useful for discovering communities related to specific topics.



## OpenAPI

````yaml get /v1/twitter/communities/search
openapi: 3.1.0
info:
  title: ScrapeBadger Twitter API
  description: >-
    The ScrapeBadger Twitter API provides programmatic access to Twitter/X data
    through a simple REST interface. Retrieve tweets, user profiles, followers,
    lists, communities, trends, and geographic data — all with a single API key.


    All endpoints require authentication via the `x-api-key` header. Each
    request consumes credits from your account balance. Paginated endpoints
    return a `next_cursor` field that you can pass to subsequent requests to
    retrieve additional pages of results.


    **Base URL:** `https://scrapebadger.com/v1/twitter`


    **Rate Limits:** Requests are rate-limited per API key. If you exceed your
    limit, you will receive a `429` response. Implement exponential backoff and
    retry logic for production use.


    **Credits:** Each successful API call deducts credits from your balance. If
    your balance reaches zero, subsequent requests will return `402 Payment
    Required`.
  version: 1.0.0
  contact:
    name: ScrapeBadger Support
    url: https://scrapebadger.com
    email: support@scrapebadger.com
servers:
  - url: https://scrapebadger.com
    description: Production
security:
  - apiKey: []
tags:
  - name: Tweets
    description: >-
      Retrieve tweets, search tweets, and access tweet metadata including
      replies, quotes, retweeters, favoriters, edit history, and community
      notes.
  - name: Users
    description: >-
      Retrieve user profiles, followers, following lists, mentions,
      subscriptions, and search for users.
  - name: Lists
    description: Access Twitter list details, list tweets, and search within lists.
  - name: Communities
    description: Retrieve community details, community tweets, and search for communities.
  - name: Trends
    description: Get trending topics globally or by location.
  - name: Geo
    description: Search for geographic places and retrieve place details.
  - name: Spaces
    description: Access Twitter Spaces and live broadcast details.
  - name: Stream Monitors
    description: >-
      Create and manage real-time stream monitors that track Twitter accounts
      and deliver new tweets via WebSocket or webhook.
  - name: Stream Webhooks
    description: >-
      Manage webhook endpoints for stream monitor delivery. Webhooks receive
      HMAC-SHA256 signed payloads when new tweets are detected.
  - name: Stream Logs
    description: >-
      Access delivery logs and billing logs for stream monitors. Track tweet
      detection latency, webhook delivery status, and credit consumption.
  - name: Filter Rules
    description: >-
      Create and manage filter rules that monitor Twitter using Advanced Search
      queries at configurable intervals. Delivered via WebSocket or webhook.
paths:
  /v1/twitter/communities/search:
    get:
      tags:
        - Communities
      summary: Search communities
      description: >-
        Search for Twitter communities by name, description, or keywords.
        Returns matching communities with comprehensive information including
        member count, join policy, and description. Useful for discovering
        communities related to specific topics.
      operationId: searchCommunities
      parameters:
        - name: query
          in: query
          required: true
          description: Search query to match against community names and descriptions.
          schema:
            type: string
            example: web development
        - name: cursor
          in: query
          required: false
          description: Pagination cursor for fetching the next page of results.
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved communities.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunitiesResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  schemas:
    CommunitiesResponse:
      type: object
      description: Paginated list of communities.
      properties:
        data:
          type:
            - array
            - 'null'
          description: Array of community objects.
          items:
            $ref: '#/components/schemas/CommunityData'
        next_cursor:
          type:
            - string
            - 'null'
          description: Cursor for fetching the next page. Null if no more results.
    CommunityData:
      type: object
      description: Comprehensive Twitter community data.
      required:
        - id
        - name
      properties:
        id:
          type: string
          description: Unique community identifier.
          example: '1234567890'
        name:
          type: string
          description: Name of the community.
          example: Web Developers
        description:
          type:
            - string
            - 'null'
          description: Description of the community.
        member_count:
          type:
            - integer
            - 'null'
          description: Number of members.
        is_member:
          type:
            - boolean
            - 'null'
          description: Whether the authenticated user is a member.
        role:
          type:
            - string
            - 'null'
          description: Role of the authenticated user.
          enum:
            - member
            - moderator
            - admin
            - non_member
        is_nsfw:
          type:
            - boolean
            - 'null'
          description: Whether the community is marked as NSFW.
        join_policy:
          type:
            - string
            - 'null'
          description: Join policy for the community.
          enum:
            - Open
            - Closed
        invites_policy:
          type:
            - string
            - 'null'
          description: Invites policy for the community.
        created_at:
          type:
            - integer
            - 'null'
          description: Creation timestamp in milliseconds.
        created_at_datetime:
          type:
            - string
            - 'null'
          description: Creation date in ISO 8601 format.
        banner:
          oneOf:
            - $ref: '#/components/schemas/CommunityBanner'
            - type: 'null'
          description: Community banner image.
        creator_id:
          type:
            - string
            - 'null'
          description: Numeric ID of the community creator.
        creator_username:
          type:
            - string
            - 'null'
          description: Username of the community creator.
        creator_name:
          type:
            - string
            - 'null'
          description: Display name of the community creator.
        admin_id:
          type:
            - string
            - 'null'
          description: Numeric ID of the community admin.
        admin_username:
          type:
            - string
            - 'null'
          description: Username of the community admin.
        admin_name:
          type:
            - string
            - 'null'
          description: Display name of the community admin.
        rules:
          type:
            - array
            - 'null'
          description: Community rules.
          items:
            $ref: '#/components/schemas/CommunityRule'
    ErrorResponse:
      type: object
      description: Error response returned for failed requests.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message describing what went wrong.
    CommunityBanner:
      type: object
      description: Community banner image information.
      properties:
        url:
          type:
            - string
            - 'null'
          description: URL of the banner image.
        width:
          type:
            - integer
            - 'null'
          description: Width of the banner in pixels.
        height:
          type:
            - integer
            - 'null'
          description: Height of the banner in pixels.
    CommunityRule:
      type: object
      description: A community rule.
      properties:
        name:
          type:
            - string
            - 'null'
          description: Name/title of the rule.
        description:
          type:
            - string
            - 'null'
          description: Detailed description of the rule.
  responses:
    Unauthorized:
      description: Authentication failed. The API key is missing, invalid, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Invalid or missing API key
    PaymentRequired:
      description: >-
        Insufficient credits. Your account balance has been exhausted. Purchase
        more credits at https://scrapebadger.com/dashboard/billing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Insufficient credits
    RateLimitExceeded:
      description: >-
        Rate limit exceeded. Too many requests in a given time period. Implement
        exponential backoff and retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Rate limit exceeded. Please retry after a short delay.
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        Your ScrapeBadger API key. You can find this in your dashboard at
        https://scrapebadger.com/dashboard/api-keys.

````