File size: 784 Bytes
b556afb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import requests
import json

from config import proxycurl_api

def get_linkedin_profile(name, folder_path="data_dumpster"):

    print(f"Aspiring {name}'s linkedin soul...")

    api_key = proxycurl_api
    headers = {'Authorization': 'Bearer ' + api_key}

    api_endpoint = 'https://nubela.co/proxycurl/api/linkedin/company/resolve'
    params = {
    'company_name': name,
    'enrich_profile': 'enrich',
    'extra' : 'include'
    }

    response = requests.get(api_endpoint,
                            params=params,
                            headers=headers)
    content = response.json()
    file_path = f"{folder_path}/linkedin_content.json"

    # Write the JSON data to the file
    with open(file_path, "w") as file:
        json.dump(content, file)
    return content