Codacy API v2.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Codacy API v2 reference.
For more information see Using the Codacy API.
Base URLs:
Terms of service Email: Support License: Apache 2.0
Authentication
-
API Key (api-token)
- Parameter Name: api-token, in: header.
-
API Key (project-token)
- Parameter Name: project-token, in: header.
commit
Operations about commits
commitDetailByUuid
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/commit/{commitUuid} \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/commit/{commitUuid} HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/commit/{commitUuid}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/commit/{commitUuid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/commit/{commitUuid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/commit/{commitUuid}', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/commit/{commitUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/commit/{commitUuid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/commit/{commitUuid}
Returns the commit detail
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
{
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | CodacyAPICommitResponse |
analyse
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/commit/{commitUuid}/analyse \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/commit/{commitUuid}/analyse HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/commit/{commitUuid}/analyse',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/commit/{commitUuid}/analyse',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/commit/{commitUuid}/analyse',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/commit/{commitUuid}/analyse', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/commit/{commitUuid}/analyse");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/commit/{commitUuid}/analyse", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/commit/{commitUuid}/analyse
Analyse a commit
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
true
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | boolean |
notifyCoverageFinal
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/commit/{commitUuid}/coverageFinal \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/commit/{commitUuid}/coverageFinal HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/commit/{commitUuid}/coverageFinal',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/commit/{commitUuid}/coverageFinal',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/commit/{commitUuid}/coverageFinal',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/commit/{commitUuid}/coverageFinal', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/commit/{commitUuid}/coverageFinal");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/commit/{commitUuid}/coverageFinal", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/commit/{commitUuid}/coverageFinal
Notifies that all reports were sent
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
commitDelta
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/commit/{commitUuid}/delta \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/commit/{commitUuid}/delta HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/commit/{commitUuid}/delta',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/commit/{commitUuid}/delta',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/commit/{commitUuid}/delta',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/commit/{commitUuid}/delta', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/commit/{commitUuid}/delta");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/commit/{commitUuid}/delta", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/commit/{commitUuid}/delta
Returns the commit delta
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
{
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | CodacyAPICommitResponse |
issueBreakdown
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/commit/{commitUuid}/issueBreakdown \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/commit/{commitUuid}/issueBreakdown HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/commit/{commitUuid}/issueBreakdown',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/commit/{commitUuid}/issueBreakdown',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/commit/{commitUuid}/issueBreakdown',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/commit/{commitUuid}/issueBreakdown', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/commit/{commitUuid}/issueBreakdown");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/commit/{commitUuid}/issueBreakdown", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/commit/{commitUuid}/issueBreakdown
Issue breakdown for a commit
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
true
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | boolean |
saveCoverage
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/coverage/{commitUuid}/{language} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/coverage/{commitUuid}/{language} HTTP/1.1
Host: api.codacy.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/coverage/{commitUuid}/{language}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"fileReports": [
{
"filename": "src/main/MyRules.java",
"coverage": {
"1": "1",
"5": "1",
"6": "3",
"7": "1",
"8": "2",
"9": "1"
}
},
{
"filename": "src/main/Main.java",
"coverage": {
"1": "3",
"5": "0",
"6": "1"
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/coverage/{commitUuid}/{language}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/coverage/{commitUuid}/{language}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/coverage/{commitUuid}/{language}', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/coverage/{commitUuid}/{language}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/coverage/{commitUuid}/{language}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/coverage/{commitUuid}/{language}
Receives the commit coverage information
Body parameter
{
"fileReports": [
{
"filename": "src/main/MyRules.java",
"coverage": {
"1": "1",
"5": "1",
"6": "3",
"7": "1",
"8": "2",
"9": "1"
}
},
{
"filename": "src/main/Main.java",
"coverage": {
"1": "3",
"5": "0",
"6": "1"
}
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
commitUuid | path | string | true | commit sha hash |
language | path | string | true | coverage language |
partial | query | boolean | false | is partial coverage |
body | body | CoverageReport | true | coverage report |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
commitDetailByProjectName
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid} \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid} HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/{username}/{projectName}/commit/{commitUuid}
Returns the commit detail
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
{
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | CodacyAPICommitResponse |
analyseWithProjectName
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/analyse \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/analyse HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/analyse',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/analyse',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/analyse',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/analyse', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/analyse");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/analyse", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{username}/{projectName}/commit/{commitUuid}/analyse
Analyse a commit
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
true
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | boolean |
saveCoverageWithAccountToken
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language} HTTP/1.1
Host: api.codacy.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"fileReports": [
{
"filename": "src/main/MyRules.java",
"coverage": {
"1": "1",
"5": "1",
"6": "3",
"7": "1",
"8": "2",
"9": "1"
}
},
{
"filename": "src/main/Main.java",
"coverage": {
"1": "3",
"5": "0",
"6": "1"
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language}', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverage/{language}
Receives the commit coverage information
Body parameter
{
"fileReports": [
{
"filename": "src/main/MyRules.java",
"coverage": {
"1": "1",
"5": "1",
"6": "3",
"7": "1",
"8": "2",
"9": "1"
}
},
{
"filename": "src/main/Main.java",
"coverage": {
"1": "3",
"5": "0",
"6": "1"
}
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationProvider | path | string | true | Organization Provider [gh, bb, ghe, bbe, gl, gle] |
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
language | path | string | true | coverage language |
partial | query | boolean | false | is partial coverage |
body | body | CoverageReport | true | coverage report |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
coverageFinalNotificationWithAccountToken
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/coverageFinal
Notifies that all reports were sent
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationProvider | path | string | true | Organization Provider [gh, bb, ghe, bbe, gl, gle] |
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
saveIssuesResultsWithAccountToken
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults HTTP/1.1
Host: api.codacy.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '[
{
"tool": "string",
"issues": null
}
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/issuesRemoteResults
Receives remote issues reports
Body parameter
[
{
"tool": "string",
"issues": null
}
]
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationProvider | path | string | true | Organization Provider [gh, bb, ghe, bbe, gl, gle] |
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
body | body | IssuesResultList | true | IssuesResult |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
saveMetricsResultsWithAccountToken
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults HTTP/1.1
Host: api.codacy.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '[
{
"language": "string",
"metrics": null
}
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/metricsRemoteResults
Receives remote metrics reports
Body parameter
[
{
"language": "string",
"metrics": null
}
]
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationProvider | path | string | true | Organization Provider [gh, bb, ghe, bbe, gl, gle] |
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
body | body | MetricsResultList | true | MetricsResult |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
saveDuplicationResultsWithAccountToken
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult HTTP/1.1
Host: api.codacy.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '[
{
"language": "string",
"duplication": null
}
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/MetricsResult
Receives remote issues reports
Body parameter
[
{
"language": "string",
"duplication": null
}
]
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationProvider | path | string | true | Organization Provider [gh, bb, ghe, bbe, gl, gle] |
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
body | body | DuplicationResultList | true | DuplicationResult |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
resultsFinalNotificationWithAccountToken
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{provider}/{username}/{projectName}/commit/{commitUuid}/resultsFinal
Notifies that all reports were sent
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationProvider | path | string | true | Organization Provider [gh, bb, ghe, bbe, gl, gle] |
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
deltaWithProjectName
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/delta \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/delta HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/delta',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/delta',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/delta',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/delta', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/delta");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/{username}/{projectName}/commit/{commitUuid}/delta", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/{username}/{projectName}/commit/{commitUuid}/delta
Returns the commit delta
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
commitUuid | path | string | true | commit sha hash |
Example responses
200 Response
{
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | CodacyAPICommitResponse |
project
Operations about projects
projectDetail
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/project \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/project HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/project',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/project',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/project',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/project', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/project");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/project", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/project
Request project details
Example responses
200 Response
{
"commit": {
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
},
"name": "string",
"urls": [
{
"name": "string",
"url": "string"
}
],
"user": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | ProjectResponse |
projectAnalysisConfiguration
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/project/analysis/configuration \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/project/analysis/configuration HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/project/analysis/configuration',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/project/analysis/configuration',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/project/analysis/configuration',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/project/analysis/configuration', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/project/analysis/configuration");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/project/analysis/configuration", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/project/analysis/configuration
Retrieve the project analysis configuration
Example responses
200 Response
{
"defaultIgnores": [
"string"
],
"ignoredPaths": [
"string"
],
"projectExtensions": [
{
"extensions": [
"string"
],
"language": {
"extensions": [
"string"
],
"files": [
"string"
],
"name": "string"
}
}
],
"toolConfiguration": [
{
"enabled": true,
"notEdited": true,
"patterns": [
{
"parameters": [
{
"name": "string",
"value": "string"
}
],
"internalId": "string"
}
],
"uuid": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | ProjectConfiguration |
deleteProject
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/project/delete \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/project/delete HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/project/delete',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/project/delete',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/project/delete',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/project/delete', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/project/delete");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/project/delete", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/project/delete
Delete a project
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
getFileDataByPath
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/project/file/data/{filePath} \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/project/file/data/{filePath} HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/project/file/data/{filePath}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/project/file/data/{filePath}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/project/file/data/{filePath}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/project/file/data/{filePath}', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/project/file/data/{filePath}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/project/file/data/{filePath}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/project/file/data/{filePath}
Data of a file
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filePath | path | string | true | File path |
branch | query | string | false | Branch name (if not specified main branch will be used) |
Example responses
200 Response
{
"grade": "string",
"path": "string",
"url": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | FileData |
getFileIssuesByPath
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/project/file/issues/{filePath} \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/project/file/issues/{filePath} HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/project/file/issues/{filePath}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/project/file/issues/{filePath}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/project/file/issues/{filePath}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/project/file/issues/{filePath}', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/project/file/issues/{filePath}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/project/file/issues/{filePath}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/project/file/issues/{filePath}
Issues of a file
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filePath | path | string | true | File path |
branch | query | string | false | Branch name (if not specified main branch will be used) |
Example responses
200 Response
[
{
"cost": 0,
"level": "string",
"message": "string",
"patternId": 0,
"startLine": 0,
"url": "string"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [FileIssue] | false | none | none |
» cost | integer(int32) | false | none | none |
» level | string | false | none | none |
» message | string | false | none | none |
» patternId | integer(int64) | false | none | none |
» startLine | integer(int32) | false | none | none |
» url | string | false | none | none |
listProjects
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/project/list \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/project/list HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/project/list',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/project/list',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/project/list',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/project/list', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/project/list");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/project/list", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/project/list
List projects
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationProvider | query | string | false | Organization Provider [gh, bb, ghe, bbe, gl, gle] |
organizationName | query | string | false | Organization Name |
cursor | query | string | false | Cursor to start listing results |
size | query | integer(int32) | false | Size to limit results returned |
Example responses
200 Response
[
{
"commit": {
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
},
"name": "string",
"urls": [
{
"name": "string",
"url": "string"
}
],
"user": "string"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [ProjectResponse] | false | none | none |
» commit | object | false | none | none |
»» commit | object | false | none | none |
»»» complexity | object | false | none | none |
»»» coverage | object | false | none | none |
»»» grade | string | false | none | none |
»»» nrClones | object | false | none | none |
»»» nrIssues | integer(int64) | false | none | none |
»» delta | object | false | none | none |
»»» complexity | object | false | none | none |
»»» coverage | object | false | none | none |
»»» files | [CodacyAPIFile] | false | none | none |
»»»» complexity | object | false | none | none |
»»»» coverage | object | false | none | none |
»»»» fixedIssues | integer(int32) | false | none | none |
»»»» newIssues | integer(int32) | false | none | none |
»»»» nrClones | object | false | none | none |
»»»» path | string | false | none | none |
»»» fixedIssues | integer(int32) | false | none | none |
»»» newIssues | integer(int32) | false | none | none |
»»» nrClones | object | false | none | none |
»» sha | string | false | none | none |
»» state | string | false | none | none |
»» urls | [CodacyAPIURL] | false | none | none |
»»» name | string | false | none | none |
»»» url | string | false | none | none |
»» name | string | false | none | none |
»» urls | [CodacyAPIURL] | false | none | none |
»» user | string | false | none | none |
Response Headers
Status | Header | Type | Format | Description |
---|---|---|---|---|
200 | cursor | string | Cursor to request the next page | |
200 | size | integer | Requested size |
updateProject
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/project/update \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/project/update HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/project/update',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/project/update',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/project/update',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/project/update', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/project/update");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/project/update", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/project/update
Request project update
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
projectAnalysisConfigurationByProjectName
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/project/{username}/{projectName}/analysis/configuration \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/project/{username}/{projectName}/analysis/configuration HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/project/{username}/{projectName}/analysis/configuration',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/project/{username}/{projectName}/analysis/configuration',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/project/{username}/{projectName}/analysis/configuration',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/project/{username}/{projectName}/analysis/configuration', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/project/{username}/{projectName}/analysis/configuration");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/project/{username}/{projectName}/analysis/configuration", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/project/{username}/{projectName}/analysis/configuration
Retrieve the project analysis configuration
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
Example responses
200 Response
{
"defaultIgnores": [
"string"
],
"ignoredPaths": [
"string"
],
"projectExtensions": [
{
"extensions": [
"string"
],
"language": {
"extensions": [
"string"
],
"files": [
"string"
],
"name": "string"
}
}
],
"toolConfiguration": [
{
"enabled": true,
"notEdited": true,
"patterns": [
{
"parameters": [
{
"name": "string",
"value": "string"
}
],
"internalId": "string"
}
],
"uuid": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | ProjectConfiguration |
projectAnalysisConfigurationByProjectNameWithAccountToken
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/{provider}/{username}/{projectName}/analysis/configuration \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/{provider}/{username}/{projectName}/analysis/configuration HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/analysis/configuration',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/analysis/configuration',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/{provider}/{username}/{projectName}/analysis/configuration',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/{provider}/{username}/{projectName}/analysis/configuration', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{provider}/{username}/{projectName}/analysis/configuration");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/{provider}/{username}/{projectName}/analysis/configuration", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/{provider}/{username}/{projectName}/analysis/configuration
Retrieve the project analysis configuration using an Account Token
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationProvider | path | string | true | Organization Provider [gh, bb, ghe, bbe, gl, gle] |
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
Example responses
200 Response
{
"defaultIgnores": [
"string"
],
"ignoredPaths": [
"string"
],
"projectExtensions": [
{
"extensions": [
"string"
],
"language": {
"extensions": [
"string"
],
"files": [
"string"
],
"name": "string"
}
}
],
"toolConfiguration": [
{
"enabled": true,
"notEdited": true,
"patterns": [
{
"parameters": [
{
"name": "string",
"value": "string"
}
],
"internalId": "string"
}
],
"uuid": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | ProjectConfiguration |
projectDetailsByProjectName
Code samples
# You can also use wget
curl -X GET https://api.codacy.com/2.0/{username}/{projectName} \
-H 'Accept: application/json'
GET https://api.codacy.com/2.0/{username}/{projectName} HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{username}/{projectName}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{username}/{projectName}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.codacy.com/2.0/{username}/{projectName}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.codacy.com/2.0/{username}/{projectName}', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{username}/{projectName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.codacy.com/2.0/{username}/{projectName}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /2.0/{username}/{projectName}
Request project details
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
branch | query | string | false | branch name |
Example responses
200 Response
{
"commit": {
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
},
"name": "string",
"urls": [
{
"name": "string",
"url": "string"
}
],
"user": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | ProjectResponse |
deleteWithProjectName
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{username}/{projectName}/delete \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{username}/{projectName}/delete HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{username}/{projectName}/delete',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{username}/{projectName}/delete',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{username}/{projectName}/delete',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{username}/{projectName}/delete', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{username}/{projectName}/delete");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{username}/{projectName}/delete", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{username}/{projectName}/delete
Delete a project
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | string |
updateWithProjectName
Code samples
# You can also use wget
curl -X POST https://api.codacy.com/2.0/{username}/{projectName}/update \
-H 'Accept: application/json'
POST https://api.codacy.com/2.0/{username}/{projectName}/update HTTP/1.1
Host: api.codacy.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://api.codacy.com/2.0/{username}/{projectName}/update',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('https://api.codacy.com/2.0/{username}/{projectName}/update',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.codacy.com/2.0/{username}/{projectName}/update',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('https://api.codacy.com/2.0/{username}/{projectName}/update', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.codacy.com/2.0/{username}/{projectName}/update");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.codacy.com/2.0/{username}/{projectName}/update", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /2.0/{username}/{projectName}/update
Request project update
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
username | path | string | true | owner of the project |
projectName | path | string | true | project name |
Example responses
200 Response
true
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | No response was specified | boolean |
Schemas
CodacyAPICommit
{
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
complexity | object | false | none | none |
coverage | object | false | none | none |
grade | string | false | none | none |
nrClones | object | false | none | none |
nrIssues | integer(int64) | false | none | none |
CodacyAPICommitDelta
{
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
complexity | object | false | none | none |
coverage | object | false | none | none |
files | [CodacyAPIFile] | false | none | none |
fixedIssues | integer(int32) | false | none | none |
newIssues | integer(int32) | false | none | none |
nrClones | object | false | none | none |
CodacyAPICommitResponse
{
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
commit | CodacyAPICommit | false | none | none |
delta | CodacyAPICommitDelta | false | none | none |
sha | string | false | none | none |
state | string | false | none | none |
urls | [CodacyAPIURL] | false | none | none |
CodacyAPIFile
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
complexity | object | false | none | none |
coverage | object | false | none | none |
fixedIssues | integer(int32) | false | none | none |
newIssues | integer(int32) | false | none | none |
nrClones | object | false | none | none |
path | string | false | none | none |
CodacyAPIURL
{
"name": "string",
"url": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | false | none | none |
url | string | false | none | none |
FileData
{
"grade": "string",
"path": "string",
"url": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
grade | string | false | none | none |
path | string | false | none | none |
url | string | false | none | none |
FileIssue
{
"cost": 0,
"level": "string",
"message": "string",
"patternId": 0,
"startLine": 0,
"url": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
cost | integer(int32) | false | none | none |
level | string | false | none | none |
message | string | false | none | none |
patternId | integer(int64) | false | none | none |
startLine | integer(int32) | false | none | none |
url | string | false | none | none |
Language
{
"extensions": [
"string"
],
"files": [
"string"
],
"name": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
extensions | [string] | false | none | none |
files | [string] | false | none | none |
name | string | false | none | none |
LanguageExtensions
{
"extensions": [
"string"
],
"language": {
"extensions": [
"string"
],
"files": [
"string"
],
"name": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
extensions | [string] | false | none | none |
language | Language | false | none | none |
ProjectConfiguration
{
"defaultIgnores": [
"string"
],
"ignoredPaths": [
"string"
],
"projectExtensions": [
{
"extensions": [
"string"
],
"language": {
"extensions": [
"string"
],
"files": [
"string"
],
"name": "string"
}
}
],
"toolConfiguration": [
{
"enabled": true,
"notEdited": true,
"patterns": [
{
"parameters": [
{
"name": "string",
"value": "string"
}
],
"internalId": "string"
}
],
"uuid": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
defaultIgnores | [string] | false | none | none |
ignoredPaths | [string] | false | none | none |
projectExtensions | [LanguageExtensions] | false | none | none |
toolConfiguration | [ToolConfiguration] | false | none | none |
ProjectResponse
{
"commit": {
"commit": {
"complexity": {},
"coverage": {},
"grade": "string",
"nrClones": {},
"nrIssues": 0
},
"delta": {
"complexity": {},
"coverage": {},
"files": [
{
"complexity": {},
"coverage": {},
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {},
"path": "string"
}
],
"fixedIssues": 0,
"newIssues": 0,
"nrClones": {}
},
"sha": "string",
"state": "string",
"urls": [
{
"name": "string",
"url": "string"
}
]
},
"name": "string",
"urls": [
{
"name": "string",
"url": "string"
}
],
"user": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
commit | CodacyAPICommitResponse | false | none | none |
name | string | false | none | none |
urls | [CodacyAPIURL] | false | none | none |
user | string | false | none | none |
ToolConfiguration
{
"enabled": true,
"notEdited": true,
"patterns": [
{
"parameters": [
{
"name": "string",
"value": "string"
}
],
"internalId": "string"
}
],
"uuid": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
enabled | boolean | false | none | none |
notEdited | boolean | false | none | none |
patterns | [ToolPattern] | false | none | none |
uuid | string | false | none | none |
ToolParameter
{
"name": "string",
"value": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | false | none | none |
value | string | false | none | none |
ToolPattern
{
"parameters": [
{
"name": "string",
"value": "string"
}
],
"internalId": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
parameters | [ToolParameter] | false | none | none |
internalId | string | false | none | none |
CoverageReportLines
{
"1": "3",
"5": "0",
"6": "1"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
additionalProperties | string | false | none | none |
CoverageReportFile
{
"filename": "src/main/Main.java",
"coverage": {
"1": "3",
"5": "0",
"6": "1"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
filename | string | false | none | none |
coverage | CoverageReportLines | false | none | none |
CoverageReport
{
"fileReports": [
{
"filename": "src/main/MyRules.java",
"coverage": {
"1": "1",
"5": "1",
"6": "3",
"7": "1",
"8": "2",
"9": "1"
}
},
{
"filename": "src/main/Main.java",
"coverage": {
"1": "3",
"5": "0",
"6": "1"
}
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
fileReports | [CoverageReportFile] | false | none | none |
IssuesResultList
[
{
"tool": "string",
"issues": null
}
]
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [IssuesResult] | false | none | none |
IssuesResult
{
"tool": "string",
"issues": null
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
tool | string | false | none | none |
issues | json | false | none | none |
MetricsResultList
[
{
"language": "string",
"metrics": null
}
]
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [MetricsResult] | false | none | none |
MetricsResult
{
"language": "string",
"metrics": null
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
language | string | false | none | none |
metrics | json | false | none | none |
DuplicationResultList
[
{
"language": "string",
"duplication": null
}
]
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [DuplicationResult] | false | none | none |
DuplicationResult
{
"language": "string",
"duplication": null
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
language | string | false | none | none |
duplication | json | false | none | none |