Get a character by ID
GET
https://rickandmortyapi.com/api/character/{id}
Request
Path Params
id
string
required
Example:
20
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://rickandmortyapi.com/api/character/20'
Responses
🟢200The requested character
application/json
Body
id
integer
optional
name
string
optional
status
string
optional
species
string
optional
type
string
optional
gender
string
optional
origin
object
optional
name
string
optional
url
string
optional
location
object
optional
name
string
optional
url
string
optional
image
string
optional
episode
array[string]
optional
url
string
optional
created
string
optional
Example
{
"id": 20,
"name": "Ants in my Eyes Johnson",
"status": "unknown",
"species": "Human",
"type": "Human with ants in his eyes",
"gender": "Male",
"origin": {
"name": "unknown",
"url": ""
},
"location": {
"name": "Interdimensional Cable",
"url": "https://rickandmortyapi.com/api/location/6"
},
"image": "https://rickandmortyapi.com/api/character/avatar/20.jpeg",
"episode": [
"https://rickandmortyapi.com/api/episode/8"
],
"url": "https://rickandmortyapi.com/api/character/20",
"created": "2017-11-04T22:34:53.659Z"
}
Modified at 2024-04-08 20:02:52