-
velog api 조사개인 프로젝트/1. velog -> tistory 데이터 이전 2023. 12. 16. 00:03
참고 : https://velog.io/@isntkyu/NodeJs-벨로그-전체-게시글-조회수-통계-API-만들어봄
-
request url
https://v2.velog.io/graphql
-
request method
post
-
request header
-
Content-Type
:application/json
-
Cookie
: chrome console - network 에서 겟 -> 비밀 글 등 개인적인 정보 조회 필요시 cookie를 header에 넣어줘야 한다.
-
json 정보
1. 시리즈 목록 정보 조회
- request :
{ "operationName": "UserSeriesList", "variables": { "username": username }, "query": "query UserSeriesList($username: String!) {\n user(username: $username) {\n id\n series_list {\n id\n name\n description\n url_slug\n thumbnail\n updated_at\n posts_count\n __typename\n }\n __typename\n }\n}\n" }
- response :
{ "data":{ "user":{ "id": String, "series_list":[ { "id": String, "name": String, "posts_count": int }, ... ] } } }
2. 글 목록 정보 조회
- request :
{ "operationName":"Posts", "variables":{ "username":username, "cursor": post_id, "limit": 100 }, "query":"query Posts($cursor: ID, $username: String, $temp_only: Boolean, $tag: String, $limit: Int) {\n posts(cursor: $cursor, username: $username, temp_only: $temp_only, tag: $tag, limit: $limit) {\n id\n title\n short_description\n thumbnail\n user {\n id\n username\n profile {\n id\n thumbnail\n __typename\n }\n __typename\n }\n url_slug\n released_at\n updated_at\n comments_count\n tags\n is_private\n likes\n __typename\n }\n}\n" }
- response : ```shell { "data": { "posts": [ { "id": String, "title": String, "short_description": String, "thumbnail": String, "url_slug": String, "released_at": LocalDateTime "updated_at": LocalDateTime "comments_count": int, "tags": [String, .. ], "is_private": boolean, "likes": int, "__typename": String }, {} ] } }
3. 글 내용 조회
- request :
{ "operationName":"ReadPost", "variables":{ "username":username, "url_slug":url_slug }, "query":"query ReadPost($username: String, $url_slug: String) {\n post(username: $username, url_slug: $url_slug) {\n id\n title\n released_at\n updated_at\n tags\n body\n short_description\n is_markdown\n is_private\n is_temp\n thumbnail\n comments_count\n url_slug\n likes\n liked\n user {\n id\n username\n profile {\n id\n display_name\n thumbnail\n short_bio\n profile_links\n __typename\n }\n velog_config {\n title\n __typename\n }\n __typename\n }\n comments {\n id\n user {\n id\n username\n profile {\n id\n thumbnail\n __typename\n }\n __typename\n }\n text\n replies_count\n level\n created_at\n level\n deleted\n __typename\n }\n series {\n id\n name\n url_slug\n series_posts {\n id\n post {\n id\n title\n url_slug\n user {\n id\n username\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n linked_posts {\n previous {\n id\n title\n url_slug\n user {\n id\n username\n __typename\n }\n __typename\n }\n next {\n id\n title\n url_slug\n user {\n id\n username\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n" }
- response : ```shell { "data":{ "post":{ "id": String, "title": String, "released_at": LocalDateTime, "updated_at": LocalDateTime, "tags":[String, ...], "body": String, // 본문 내용 "short_description": String, "is_markdown": boolean, "is_private": boolean, "is_temp": boolean, "thumbnail": String, "comments_count": int, "url_slug": String, "likes": int, "liked": boolean, "comments":[], "series":{ "id": String, "name": String } } } }
'개인 프로젝트 > 1. velog -> tistory 데이터 이전' 카테고리의 다른 글
개발 중 기록을 많이 하지 못함.. (0) 2023.12.18 티스토리 블로그에 목차 달기 (링크) (0) 2023.11.19 (링크) 티스토리 api (0) 2023.11.19 -