Using the Codacy API¶
The Codacy API allows you to programmatically retrieve and analyze data from Codacy and perform a few configuration changes.
Codacy supports two API versions but we strongly recommend using the new API v3 when possible since it's the version being actively developed:
API v3 (recommended) | API v2 | |
---|---|---|
Endpoint documentation | https://api.codacy.com/api/api-docs | https://api.codacy.com/swagger |
Base URL | https://api.codacy.com/api/v3 |
https://api.codacy.com/ |
Overview |
The new endpoints allow you to access and manipulate the following resources, among others:
|
The legacy endpoints allow you to access and manipulate the following resources: |
Important
If you're using Codacy Self-hosted you must update the base URL of the APIs to include your Codacy instance domain name. For example:
https://codacy.example.com/api/v3
Authenticating requests to the Codacy API¶
Most API endpoints require that you provide either a project or account API token. After obtaining the necessary tokens, include them in your request headers using the format api-token: <token key>
or project-token: <token key>
.
For example, to make a request to an API v3 endpoint that requires an account API token:
curl -X GET https://api.codacy.com/api/v3/user/organizations/gh \
-H "api-token: SjE9y7ekgKdpaCofsAhd"
Or to make a request to an API v2 endpoint that requires a project API token:
curl -X GET https://api.codacy.com/2.0/commit/da275c14ffab6e402dcc6009828067ffa44b7ee0 \
-H "project-token: c9f2feb28e780acc8dc40754978b8bd9"
Feedback
Did this page help you?
Thank you for the feedback!
We're sorry to hear that. Please let us know what we can improve.
If you have a question, please ask our community or contact support@codacy.com.