도그사운드 2024. 12. 31. 13:39

Linkedin의 데이터를 끌어올수 있다. 이 api를 이용해서 끌어온 데이터로 langchain에게 작업을 시켜볼 수 있다.

import requests

api_key = 'YOUR_API_KEY'
headers = {'Authorization': 'Bearer ' + api_key}
api_endpoint = 'https://nubela.co/proxycurl/api/v2/linkedin'
params = {
    'twitter_profile_url': 'https://x.com/johnrmarty/',
    'facebook_profile_url': 'https://facebook.com/johnrmarty/',
    'linkedin_profile_url': 'https://linkedin.com/in/johnrmarty/',
    'extra': 'include',
    'github_profile_id': 'include',
    'facebook_profile_id': 'include',
    'twitter_profile_id': 'include',
    'personal_contact_number': 'include',
    'personal_email': 'include',
    'inferred_salary': 'include',
    'skills': 'include',
    'use_cache': 'if-present',
    'fallback_to_cache': 'on-error',
}
response = requests.get(api_endpoint,
                        params=params,
                        headers=headers)

 

api키를 입력해서 response를 받을 수 있다.

response.json()

response._content

 

response._content로 내용을 확인할 수 있고 카피하여 json 검증을 한다.

 

json으로 검증하기 전에 b'~'은 제외시켜야 인식된다.

 

https://gist.github.com/

 

Discover gists

GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

지스트깃허브에서는 코드, 스니펫을 공유할 수 있다.

 

이와 같이 공유 가능해진다.

<script src="https://gist.github.com/orestes74/c5c3186df9a6474c66b34a16c94edbe2.js"></script> 주소는 이와 같이 생성된다.

api를 자주 쓰지 않으려면 위의 방법으로 처리한다.