show: Get source code

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

Description

Get source code. Requires See Source Code permission on file's project, or organization membership on public projects. Each element of the result array is composed of:<ol>- Line number- Content of the line</ol>

Parameters (3)

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 source code openapi-spec
curl 'https://sonarcloud.io/api/sources/show?from=10&key=my_project%3A%2Fsrc%2Ffoo%2FBar.php&to=20'
import requests

resp = requests.get(
    "https://sonarcloud.io/api/sources/show",
    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/show", 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/show?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 17:49:27.123648 404 146ms
2026-04-16 03:39:37.385880 404 172ms
2026-04-15 01:46:52.062909 404 154ms
2026-04-14 03:16:02.282365 404 232ms
2026-04-12 16:51:12.107367 404 133ms
2026-04-10 06:46:02.895872 404 94ms
2026-04-09 02:51:26.881400 404 159ms