Overview
The REST API for LGTM provides data so that you can customize how you integrate LGTM analysis into your workflow. It includes the following resources: * `/` ([API root](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-API-root))—get version information or download the specification in OpenAPI format. * `/projects` ([Projects](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Projects))—list projects, get a summary of the current status for a project, or add new projects. * `/analyses` ([Analyses](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Analyses))—get a summary of results, download all the alerts, or trigger analysis for a specific commit. * `/codereviews` ([Code reviews](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Code-reviews))—trigger code review for a patch, and view the results. * `/operations` ([Operations](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Operations))—get information about long-running tasks, for example, analyses or code reviews that you've requested. * `/snapshots` ([Snapshots](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Snapshots))—download and upload databases representing a snapshot of a codebase. * `/queryjobs` ([Query jobs](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Query-jobs))—submit queries to evaluate against existing projects, and download their results. * `/system` ([System](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-System))—get information on the health or usage of the system. For an overview and getting started topics, see [API for LGTM](https://lgtm.com/help/lgtm/api/api-for-lgtm).
LGTM API specification is a development API from lgtm.com. Requests are authenticated with a bearer token. It is served over HTTPS. Its OpenAPI description documents 29 endpoints.
At a glance
- Authentication
- Bearer token
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Development
- Base URL
https://lgtm.com/api/v1.0- Version
- v1.0
- Endpoints
- 29
- OpenAPI
- Specification ↗
- Spec updated
- 2021-06-21
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://lgtm.com/api/v1.0/" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://lgtm.com/api/v1.0/", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"https://lgtm.com/api/v1.0/",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | / | Version information |
| GET | /analyses/{analysis-id} | Get analysis summary |
| GET | /analyses/{analysis-id}/alerts | Get detailed alert information |
| POST | /analyses/{project-id} | Run analysis of a specific commit |
| GET | /analyses/{project-id}/commits/{commit-id} | Get analysis summary for a specific commit |
| POST | /codereviews/{project-id} | Run code review for a patch |
| GET | /codereviews/{review-id} | Get results of code review |
| GET | /issues/{project-id}/{alert-key} | Get detailed alert information for an issue |
| GET | /openapi | API specification |
| GET | /operations/{operation-id} | Get operation status |
| GET | /projects | List projects |
| POST | /projects | Add a project to LGTM |
| GET | /projects/{project-id} | Get project by numeric identifier |
| DELETE | /projects/{project-id} | Delete project by numeric identifier |
| GET | /projects/{project-id}/settings/analysis-configuration | Get configuration for a project identified by numeric identifier |
| PUT | /projects/{project-id}/settings/analysis-configuration | Set the administrator configuration for a project identified by numeric identifier |
| GET | /projects/{provider}/{org}/{name} | Get project by URL identifier |
| POST | /queryjobs | Run a CodeQL query on one or more projects |
| GET | /queryjobs/{queryjob-id} | Get the status of a query job |
| GET | /queryjobs/{queryjob-id}/results | Provide a summary of results for the projects in the query job |
| GET | /queryjobs/{queryjob-id}/results/{project-id} | Fetch the results of a query job for a specific project |
| POST | /snapshots/uploads/{session-id} | Complete snapshot upload session |
| PUT | /snapshots/uploads/{session-id} | Upload snapshot |
| DELETE | /snapshots/uploads/{session-id} | Abort database upload process |
| GET | /snapshots/{project-id}/{language} | Download a snapshot |
| POST | /snapshots/{project-id}/{language} | Start snapshot upload session |
| GET | /system/health | Get a summary of the application's health |
| GET | /system/metrics | Get the identifiers and descriptions of the usage metrics |
| GET | /system/metrics/{metric-id} | Get the computed values of the specified metric |
Questions
Does the LGTM API specification API need an API key?
Yes. The LGTM API specification API uses Bearer token authentication; the documentation explains how to get credentials.
Does the LGTM API specification API support HTTPS?
Yes, the LGTM API specification API is served over HTTPS.
How many endpoints does the LGTM API specification API have?
Its OpenAPI description lists 29 endpoints in version v1.0. All of them are shown on this page.
What are alternatives to the LGTM API specification API?
Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, StackExchange.
Similar development APIs
Compare alternatives →Cloudflare
DevelopmentManage DNS, CDN, Workers and other services; documented with an official OpenAPI 3.0 spec
Azure DevOps
DevelopmentThe Azure DevOps basic components of a REST API request/response pair
IPify
DevelopmentA simple IP Address API
App Store Connect API
DevelopmentThe data structure that represents an app store connect api resource.
StackExchange
DevelopmentQ&A forum for developers
IPinfo
DevelopmentAnother simple IP Address API
Listed from APIs.guru (CC0).