SonarSource components API

Get information about a component (file, directory, project, ...) and its ancestors or descendants. Update a project or module key.

Operations 3

GET /api/components/search Search for projects. Used to provide the ability to search for any component but this option has been removed and web... #
GET /api/components/show Returns a component (file, directory, project) and its ancestors. The ancestors are ordered from the parent to the ro... #
GET /api/components/tree Navigate through components based on the chosen strategy. Requires the following permission: 'Browse' on the specifie... #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sonarsource-components-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sonarsource-components-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SonarQube Cloud Web authentication Components API
  version: v1
  description: The SonarQube Cloud Web API, derived faithfully from the machine-readable service catalog the instance publishes at /api/webservices/list.
  x-derived-from: https://sonarcloud.io/api/webservices/list
  contact:
    name: SonarSource
    url: https://community.sonarsource.com/
servers:
- url: https://sonarcloud.io
security:
- bearerToken: []
- basicToken: []
tags:
- name: components
  description: Get information about a component (file, directory, project, ...) and its ancestors or descendants. Update a project or module key.
paths:
  /api/components/search:
    get:
      operationId: componentsSearch
      summary: Search for projects. Used to provide the ability to search for any component but this option has been removed and web...
      description: Search for projects. Used to provide the ability to search for any component but this option has been removed and webservice 'api/components/tree' should be used instead for this purpose
      tags:
      - components
      parameters:
      - name: organization
        in: query
        description: Organization key
        required: true
        schema:
          type: string
        example: my-org
      - name: p
        in: query
        description: 1-based page number
        required: false
        schema:
          type: string
          default: '1'
        example: '42'
      - name: ps
        in: query
        description: Page size. Must be greater than 0 and less or equal than 500
        required: false
        schema:
          type: string
          default: '100'
        example: '20'
      - name: q
        in: query
        description: 'Limit search to: component names that contain the supplied stringcomponent keys that are exactly the same as the supplied string'
        required: false
        schema:
          type: string
        example: sonar
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Insufficient privileges
        '404':
          description: Not Found
  /api/components/show:
    get:
      operationId: componentsShow
      summary: Returns a component (file, directory, project) and its ancestors. The ancestors are ordered from the parent to the ro...
      description: 'Returns a component (file, directory, project) and its ancestors. The ancestors are ordered from the parent to the root project. Requires the following permission: ''Browse'' on the project of the specified component.'
      tags:
      - components
      parameters:
      - name: branch
        in: query
        description: Branch key
        required: false
        schema:
          type: string
        example: feature/my_branch
      - name: component
        in: query
        description: Component key
        required: true
        schema:
          type: string
        example: my_project
      - name: pullRequest
        in: query
        description: Pull request id
        required: false
        schema:
          type: string
        example: '5461'
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Insufficient privileges
        '404':
          description: Not Found
  /api/components/tree:
    get:
      operationId: componentsTree
      summary: 'Navigate through components based on the chosen strategy. Requires the following permission: ''Browse'' on the specifie...'
      description: 'Navigate through components based on the chosen strategy. Requires the following permission: ''Browse'' on the specified project. When limiting search with the q parameter, directories are not returned.'
      tags:
      - components
      parameters:
      - name: asc
        in: query
        description: Ascending sort
        required: false
        schema:
          type: string
          enum:
          - 'true'
          - 'false'
          - 'yes'
          - 'no'
          default: 'true'
      - name: branch
        in: query
        description: Branch key
        required: false
        schema:
          type: string
        example: feature/my_branch
      - name: component
        in: query
        description: Base component key. The search is based on this component.
        required: true
        schema:
          type: string
        example: my_project
      - name: p
        in: query
        description: 1-based page number
        required: false
        schema:
          type: string
          default: '1'
        example: '42'
      - name: ps
        in: query
        description: Page size. Must be greater than 0 and less or equal than 500
        required: false
        schema:
          type: string
          default: '100'
        example: '20'
      - name: pullRequest
        in: query
        description: Pull request id
        required: false
        schema:
          type: string
        example: '5461'
      - name: q
        in: query
        description: 'Limit search to: component names that contain the supplied stringcomponent keys that are exactly the same as the supplied string'
        required: false
        schema:
          type: string
        example: FILE_NAM
      - name: qualifiers
        in: query
        description: Comma-separated list of component qualifiers. Filter the results with the specified qualifiers. Possible values are:BRC - Sub-projectsDIR - DirectoriesFIL - FilesTRK - ProjectsUTS - Test Files
        required: false
        schema:
          type: string
          enum:
          - BRC
          - DIR
          - FIL
          - TRK
          - UTS
      - name: s
        in: query
        description: Comma-separated list of sort fields
        required: false
        schema:
          type: string
          enum:
          - name
          - path
          - qualifier
          default: name
        example: name, path
      - name: strategy
        in: query
        description: 'Strategy to search for base component descendants:children: return the children components of the base component. Grandchildren components are not returnedall: return all the descendants components of the base component. Grandchildren are returned.leaves: return all the descendant components (files, in general) which don''t have other children. They are the leaves of the component tree.'
        required: false
        schema:
          type: string
          enum:
          - all
          - children
          - leaves
          default: all
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Insufficient privileges
        '404':
          description: Not Found
components:
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      description: User token as Bearer token.
    basicToken:
      type: http
      scheme: basic
      description: User token as HTTP Basic username with empty password.