项目作者: tsfo1489

项目描述 :
Naver Open API
高级语言: Python
项目地址: git://github.com/tsfo1489/NaverPy.git
创建时间: 2021-07-01T00:08:30Z
项目社区:https://github.com/tsfo1489/NaverPy

开源协议:

下载


NaverPy

Naver Open API Package

Naver의 Open API를 응용한 패키지 입니다
현재 Datalab 트렌드 검색, 검색, 단축 URL 기능을 지원합니다


Example Code

Constructor

  1. from NaverPy import API, Auth
  2. auth = Auth(Client_ID. Client_Secret)
  3. api = API(auth)

Search API

  1. api.search('blog', 'Test', 'json', {'sort' : 'date'})

API.search(target, query, ext, arg)

target

검색 API의 종류 선택 Argument
자세한 내용은 Naver Open API 참조

‘blog’ : https://developers.naver.com/docs/serviceapi/search/blog/blog.md
‘news’ : https://developers.naver.com/docs/serviceapi/search/news/news.md
‘book’ : https://developers.naver.com/docs/serviceapi/search/book/book.md
‘encyc’ : https://developers.naver.com/docs/serviceapi/search/encyc/encyc.md
‘movie’ : https://developers.naver.com/docs/serviceapi/search/movie/movie.md
‘cafearticle’ : https://developers.naver.com/docs/serviceapi/search/cafearticle/cafearticle.md
‘kin’ : https://developers.naver.com/docs/serviceapi/search/kin/kin.md

query

각 검색 API의 필수 변수

ext

API의 파일 형식 선택(삭제예정)

arg

각 검색 API별 추가 옵션 설정

ShortUrl

  1. API.ShortUrl('http://d2.naver.com/helloworld/4874130')

ShortUrl(url)

API resonse를 json(python dict)형태로 return

  1. {
  2. "message":"ok",
  3. "result": {
  4. "hash":"GyvykVAu",
  5. "url":"https://me2.do/GyvykVAu",
  6. "orgUrl":"http://d2.naver.com/helloworld/4874130"
  7. }
  8. ,"code":"200"
  9. }