# LGTM API specification API

> 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))&mdash;get version information or download the specification in OpenAPI format. * `/projects` ([Projects](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Projects))&mdash;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))&mdash;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))&mdash;trigger code review for a patch, and view the results. * `/operations` ([Operations](https://lgtm.com/help/lgtm/api/api-v1#LGTM-API-specification-Operations))&mdash;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))&mdash;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))&mdash;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))&mdash;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

- Category: [Development](https://www.openparable.com/apis/category/development)
- Provider: lgtm.com
- Authentication: Bearer token
- HTTPS: Yes
- CORS: Not stated
- Base URL: https://lgtm.com/api/v1.0
- Documentation: https://lgtm.com/
- OpenAPI description: https://api.apis.guru/v2/specs/lgtm.com/v1.0/openapi.json
- Version: v1.0
- Specification updated: 2021-06-21

## Example request

```bash
curl -X GET "https://lgtm.com/api/v1.0/" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Endpoints

- `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

- [Cloudflare](https://www.openparable.com/apis/cloudflare): Manage DNS, CDN, Workers and other services; documented with an official OpenAPI 3.0 spec
- [Azure DevOps](https://www.openparable.com/apis/azure-devops): The Azure DevOps basic components of a REST API request/response pair
- [IPify](https://www.openparable.com/apis/ipify): A simple IP Address API
- [App Store Connect API](https://www.openparable.com/apis/app-store-connect): The data structure that represents an app store connect api resource.
- [StackExchange](https://www.openparable.com/apis/stackexchange): Q&A forum for developers
- [IPinfo](https://www.openparable.com/apis/ipinfo): Another simple IP Address API
- [IBM Text to Speech](https://www.openparable.com/apis/ibm-text-to-speech): Convert text to speech
- [SiteIntel](https://www.openparable.com/apis/siteintel): Extract metadata, tech stack, emails, and screenshots from any URL
- [DigitalOcean Status](https://www.openparable.com/apis/digitalocean-status): Status of all DigitalOcean services
- [Netlify](https://www.openparable.com/apis/netlify): Netlify is a hosting service for the programmable web
- [Docker Hub](https://www.openparable.com/apis/docker-hub): Interact with Docker Hub
- [MineSkin API](https://www.openparable.com/apis/mineskin): Client implementations: Java: https://github.com/InventivetalentDev/MineskinClient NodeJS: https://github.com/InventivetalentDev/mineskin-client Examples: https://github.com/MineSkin/examples

Listed from: APIs.guru (CC0). Check the provider's terms before use.

---

Source: https://www.openparable.com/apis/lgtm-specification (OpenParable). Cite the canonical URL above.
