scm: Get SCM information of source files

API: sonarcloud.io:sonarqube
Endpoint: /api/sources/scm
Response format: application/json
Auth: unknown
Method: GET
Last Status: 404
Latency: 184ms

Description

Get SCM information of source files. Require See Source Code permission on file's project Each element of the result array is composed of:<ol>- Line number- Author of the commit- Datetime of the commit (before 5.2 it was only the Date)- Revision of the commit (added in 5.2)</ol>

Parameters (4)

commits_by_line (string, query, optional, default: false)

Group lines by SCM commit if value is false, else display commits for each line, even if two consecutive lines relate to the same commit.

Constraints: {'enum': ['true', 'false', 'yes', 'no']}

from (string, query, optional, default: 1)

First line to return. Starts at 1

key (string, query, required)

File key

to (string, query, optional)

Last line to return (inclusive)

Examples (1)

Get SCM information of source files openapi-spec
curl 'https://sonarcloud.io/api/sources/scm?from=10&key=my_project%3A%2Fsrc%2Ffoo%2FBar.php&to=20'
import requests

resp = requests.get(
    "https://sonarcloud.io/api/sources/scm",
    params={
        'from': '10',
        'key': 'my_project:/src/foo/Bar.php',
        'to': '20',
    },
)
data = resp.json()
import zingu_apis

api = zingu_apis.api("sonarqube")
result = api.fetch("api/sources/scm", from=10, key="my_project:/src/foo/Bar.php", to=20)

for item in result:
    print(item)
const resp = await fetch("https://sonarcloud.io/api/sources/scm?from=10&key=my_project%3A%2Fsrc%2Ffoo%2FBar.php&to=20");
const data = await resp.json();

Probe History

Latency

Status Codes

TimeStatusLatencySize
2026-04-16 00:39:48.865131 404 184ms
2026-04-15 00:42:16.766884 404 148ms
2026-04-14 03:11:14.578699 404 177ms
2026-04-12 16:08:29.486483 404 138ms
2026-04-10 01:25:02.592668 404 108ms
2026-04-09 03:43:49.188552 404 188ms