Giter Club home page Giter Club logo

search-blog's Introduction

Blog Search API

(깃허브 : https://github.com/Haeya/search-blog)

(다운로드 : https://drive.google.com/file/d/1PBZhS2l8Ez3MyLN1w6IqfEr00VvzqHTJ/view?usp=share_link)


Description

입력된 검색어로 카카오, 네이버 블로그 검색 Open API를 활용하여 '블로그 검색 서비스'를 제공합니다.

Endpoint

GET /blog

Request Parameters

Name Type Required Default Description
query string Yes N/A 검색어
sort string No accuracy 검색 결과 정렬 기준 (accuracy - 정확도순, recency - 최신순)
page integer No 1 페이지 번호
size integer No 10 한 페이지에 보여질 검색 결과 수

Response

  • data
    • body
      • documents: 검색 결과 리스트
    • statusCodeValue: API 결과 코드 Value
    • statusCode: API 결과 코드
  • message: API 호출 메시지

Example Request

GET '/blog?query=test&sort=recency&page=1&size=10'

Example Response

  • kakao api
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
    "data": {
        "headers": {},
        "body": {
          "documents": [
              {
                  "blogname": "test blog",
                  "contents": "test data입니다...",
                  "datetime": "2023-03-22T01:01:01.000+09:00",
                  "thumbnail": "",
                  "title": "test data입니다.",
                  "url": "http://blog.naver.com/test/1"
              },
              ...,
              {
                  "blogname": "test blog",
                  "contents": "test data입니다...",
                  "datetime": "2023-03-22T01:01:01.000+09:00",
                  "thumbnail": "",
                  "title": "test data입니다.",
                  "url": "http://blog.naver.com/test/10"
              },
              ...
          ],
          "pagination": {
                "page": 1,
                "size": 10,
                "totalCount": 20,
                "totalPages": 2
          }
        },
        "statusCodeValue": 200,
        "statusCode": "OK"
    },
    "message": "success"
}
  • naver api: kakao api의 결과 코드가 200이 아닌 경우
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
    "data": {
        "headers": {},
        "body": {
          "documents": [
              {
                  "title": "test data입니다.",
                  "link": "https://blog.naver.com/test/1",
                  "description": "test data입니다...",
                  "bloggername": "testblogger",
                  "bloggerlink": "blog.naver.com/test",
                  "postdate": "20230322"
              },
              ...,
              {
                  "title": "test data입니다.",
                  "link": "https://blog.naver.com/test/10",
                  "description": "test data입니다...",
                  "bloggername": "testblogger",
                  "bloggerlink": "blog.naver.com/test",
                  "postdate": "20230322"
              }
          ],
          "pagination": {
                "page": 1,
                "size": 10,
                "totalCount": 20,
                "totalPages": 2
          }
        },
        "statusCodeValue": 200,
        "statusCode": "OK"
    },
    "message": "success"
}

Description

많이 검색된 순서대로 최대 10개의 검색어를 반환합니다.

Endpoint

GET /keyword

Request Parameters

Name Type Required Default Description
size integer No 10 키워드 목록에 포함될 최대 검색어 수

Response

  • data
    • keywords: 인기 검색어
    • count: 검색어 별 검색된 횟수
  • message: API 호출 메시지

Example Request

GET '/keyword?size=4'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
  "data": [
    {
      "keyword": "spring boot",
      "count": 30
    },
    {
      "keyword": "kotlin",
      "count": 25
    },
    {
      "keyword": "restful api",
      "count": 20
    },
    {
      "keyword": "java",
      "count": 10
    }
  ],
  "message": "success"
}

search-blog's People

Contributors

haeya avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.