LeetCode API Documentation


Introduction

Welcome to the documentation for the unofficial LeetCode API. This API allows you to fetch various details about LeetCode users, including profiles, badges, skill statistics, and more. You can integrate this data into your applications to provide insights and analytics about LeetCode users.

Base URL

The base URL for the API is https://leetcode-api.snehkr.in. All endpoints are relative to this base URL.

Demo URL

CLICK HERE FOR TESTING

Endpoints


1️⃣ Fetch User Details


Endpoint: /api/?user={user}&query={query}

Basic Example Request

curl -X GET "https://leetcode-api.snehkr.in/api/?user=snehkr&query=userPublicProfile"

Basic LeetCode Queries


2️⃣ Fetch Questions Details


Endpoint: /api/?query={query}&slug={slug}

Questions Example Request

curl -X GET "https://leetcode-api.snehkr.in/api/?query={query}&slug={slug}"

Questions LeetCode Queries

Find me on:

Messenger Badge