GET /users/{id}

Get User by ID

Retrieve detailed information about a specific user by their unique identifier including profile and metadata

Overview

Retrieves detailed information about a specific user by their ID.

Path Parameters

Path Parameters

id required
integer

The unique identifier of the user to retrieve

Response

id integer

Unique identifier for the user

name string

Full name of the user

username string

Unique username

email string

Email address

phone string

Phone number

website string

Personal website URL

Error Responses

StatusDescription
404User not found - the specified ID does not exist
Terminal window
curl -X GET "https://jsonplaceholder.typicode.com/users/1"
const response = await fetch("https://jsonplaceholder.typicode.com/users/1");
const data = await response.json();
console.log(data);
import requests
response = requests.get("https://jsonplaceholder.typicode.com/users/1")
print(response.json())
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "[email protected]",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
}
{
"error": "User not found"
}
Request
curl -X GET "https://jsonplaceholder.typicode.com/users/{id}" \
  -H "Content-Type: application/json"
const response = await fetch("https://jsonplaceholder.typicode.com/users/{id}", {
  method: "GET",
  headers: {
    "Content-Type": "application/json"
},
});

const data = await response.json();
console.log(data);
import requests

response = requests.get(
    "https://jsonplaceholder.typicode.com/users/{id}",
    headers={'Content-Type':'application/json'},
)

print(response.json())
package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {
    req, _ := http.NewRequest("GET", "https://jsonplaceholder.typicode.com/users/{id}", nil)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
Response
Send a request to see the response