Random User Generator, 무료 랜덤 유저 데이터 API 제공 본문

개발 관련 유용한 아이템들

Random User Generator, 무료 랜덤 유저 데이터 API 제공

알 수 없는 사용자 2021. 6. 15. 07:01

안녕하세요, 데브 지안입니다!

 

오늘은 api key를 발급받을 필요도 없이 무료로 랜덤 한 유저 데이터를 제공해주는 Random user generator 사이트에 대해 알아볼게요.

 

사이트

https://randomuser.me/

 

Random User Generator | Home

Copyright Notice All randomly generated photos were hand picked from the authorized section of UI Faces. Please visit UI Faces FAQ for more information regarding how you can use these faces.

randomuser.me

 

먼저 호출 방법부터 알아볼게요.

GET https://randomuser.me/api

정말 간단하네요! 설명에 따르면 format 파라미터를 이용해서 원하는 포맷으로 응답받을 수 있다고 합니다.

 

포스팅하는 현재 시점에서 제공하는 포맷은 JSON, XML, CSV, YAML이라고 합니다.

<!-- XML을 요청하는 예시 -->
https://randomuser.me/api?format=xml

 

실제 웹 브라우저로 요청을 해보면 아래와 같은 응답을 매 요청마다 랜덤하게 받을 수 있습니다!

 

// 20210615055354
// https://randomuser.me/api

{
  "results": [
    {
      "gender": "male",
      "name": {
        "title": "Mr",
        "first": "Marinho",
        "last": "Almeida"
      },
      "location": {
        "street": {
          "number": 723,
          "name": "Avenida D. Pedro Ii"
        },
        "city": "Indaiatuba",
        "state": "Minas Gerais",
        "country": "Brazil",
        "postcode": 29101,
        "coordinates": {
          "latitude": "-71.8829",
          "longitude": "-16.2171"
        },
        "timezone": {
          "offset": "+3:00",
          "description": "Baghdad, Riyadh, Moscow, St. Petersburg"
        }
      },
      "email": "marinho.almeida@example.com",
      "login": {
        "uuid": "a0910673-5b19-4041-88a3-dec7783c21c0",
        "username": "purpleelephant848",
        "password": "kentucky",
        "salt": "wUeMcseI",
        "md5": "0f1a1b2aa77588d3ff9b9ef2256996c1",
        "sha1": "b24b5863bb2020c15afe493f049b2f7fcb75280e",
        "sha256": "803bd442f3e89629d6c035facea76b063ff58d290f93b7a24bdb09bbbc9e3f39"
      },
      "dob": {
        "date": "1994-11-23T21:06:38.330Z",
        "age": 27
      },
      "registered": {
        "date": "2016-01-22T06:36:21.462Z",
        "age": 5
      },
      "phone": "(45) 2710-7065",
      "cell": "(67) 5201-8452",
      "id": {
        "name": "",
        "value": null
      },
      "picture": {
        "large": "https://randomuser.me/api/portraits/men/46.jpg",
        "medium": "https://randomuser.me/api/portraits/med/men/46.jpg",
        "thumbnail": "https://randomuser.me/api/portraits/thumb/men/46.jpg"
      },
      "nat": "BR"
    }
  ],
  "info": {
    "seed": "fe43ec7991f8e57c",
    "results": 1,
    "page": 1,
    "version": "1.3"
  }
}

 

간단한 예시

https://github.com/dev-jian/get-random-users

 

dev-jian/get-random-users

example usage of randomuser api. Contribute to dev-jian/get-random-users development by creating an account on GitHub.

github.com

 

부트스트랩과 randomuser API를 이용해 간단한 예제를 만들어 봤어요.

 

유용하게 사용하셨으면 좋겠습니다!

 

그럼 이만 ~

Comments