Package: proxycurl-py-test
proxycurl-py-  The official Python client for Proxycurl API to scrape and enrich LinkedIn profiles[toc]What is Proxycurl?Proxycurlis an enrichment API to fetch fresh data on people and businesses. We are a fully-managed API that sits between your application and raw data so that you can focus on building the application; instead of worrying about building a web-scraping team and processing data at scale.With Proxycurl, you can programatically:Enrich profiles on people and companiesLookup people and companiesLookup contact information on people and companiesCheck if an email address is of a disposable natureAnd more..VisitProxycurl's websitefor more details.Before you installYou should understand thatproxycurl-pywas designed with concurrency as a first class citizen from ground-up. To installproxycurl-py,you have to pick a concurency model.We support the following concurrency models:asyncio- See implementation examplehere.gevent- See implementation examplehere.twisted- See implementation examplehere.The right way to use Proxycurl API is to make API calls concurrently. In fact, making API requests concurrently is the only way to achieve a high rate of throughput. On the default rate limit, you can enrich up to 432,000 profiles per day. Seethis blog postfor context.Installation and supported Python versionsproxycurl-pyisavailable on PyPi. For which you can install into your project with the following command:# install proxycurl-py with asyncio$pipinstall'proxycurl-py[asyncio]'# install proxycurl-py with gevent$pipinstall'proxycurl-py[gevent]'# install proxycurl-py with twisted$pipinstall'proxycurl-py[twisted]'proxycurl-pyis tested on Python3.7,3.8and3.9.Initializingproxycurl-pywith an API KeyYou can get an API key byregistering an accountwith Proxycurl. The API Key can be retrieved from the dashboard.To use Proxycurl with the API Key:You can run your script with  thePROXYCURL_API_KEYenvironment variable set.Or, you can prepend your script with the API key injected into the environment. Seeproxycurl/config.pyfor an example.Usage with examplesI will be usingproxycurl-pywith theasyncioconcurrency model to illustrate some examples on what you can do with Proxycurl and how the code will look with this library.Forexamples with other concurrency models such as:gevent, seeexamples/lib-gevent.py.twisted, seeexamples/lib-twisted.Enrich a Person ProfileGiven aLinkedIn Member Profile URL, you can get the entire profile back in structured data with Proxycurl'sPerson Profile API Endpoint.fromproxycurl_py_test.asyncioimportProxycurl,do_bulkimportasyncioimportcsvproxycurl=Proxycurl()person=asyncio.run(proxycurl.linkedin.person.get(url='https://www.linkedin.com/in/williamhgates/'))print('Person Result:',person)Enrich a Company ProfileGiven aLinkedIn Company Profile URL, enrich the URL with it's full profile with Proxycurl'sCompany Profile API Endpoint.company=asyncio.run(proxycurl.linkedin.company.get(url='https://www.linkedin.com/company/tesla-motors'))print('Company Result:',company)Lookup a personGiven a first name and a company name or domain, lookup a person with Proxycurl'sPerson Lookup API Endpoint.lookup_results=asyncio.run(proxycurl.linkedin.person.resolve(first_name="bill",last_name="gates",company_domain="microsoft"))print('Person Lookup Result:',lookup_results)Lookup a companyGiven a company name or a domain, lookup a company with Proxycurl'sCompany Lookup API Endpoint.company_lookup_results=asyncio.run(proxycurl.linkedin.company.resolve(company_name="microsoft",company_domain="microsoft.com"))print('Company Lookup Result:',company_lookup_results)Lookup a LinkedIn Profile URL from a work email addressGiven a work email address, lookup a LinkedIn Profile URL with Proxycurl'sReverse Work Email Lookup Endpoint.lookup_results=asyncio.run(proxycurl.linkedin.person.resolve_by_email(work_email="anthony.tan@grab.com"))print('Reverse Work Email Lookup Result:',lookup_results)Enrich LinkedIn member profiles in bulk (from a CSV)Given a CSV file with a list of LinkedIn member profile URLs, you can enrich the list in the following manner:# PROCESS BULK WITH CSVbulk_linkedin_person_data=[]withopen('sample.csv','r')asfile:reader=csv.reader(file)next(reader,None)forrowinreader:bulk_linkedin_person_data.append((proxycurl.linkedin.person.get,{'url':row[0]}))results=asyncio.run(do_bulk(bulk_linkedin_person_data))print('Bulk:',results)MoreasyncioexamplesMoreasyncioexamples can be found atexamples/lib-asyncio.pyRate limit and error handlingThere is no need for you to handle rate limits (429HTTP status error). Thelibrary handles rate limits automatically with exponential backoff.However, there is a need for you to handle other error codes. Errors will be returned in the form ofProxycurlException. Thelist of possible errorsis listed in our API documentation.API Endpoints and their corresponding documentationHere we list the possible API endpoints and their corresponding library functions. Do refer to each endpoint's relevant API documentation to find out the required arguments that needs to be fed into the function.FunctionEndpointAPIlinkedin.company.employee_count(**kwargs)Employee Count EndpointCompany APIlinkedin.company.resolve(**kwargs)Company Lookup EndpointCompany APIlinkedin.company.employee_list(**kwargs)Employee Listing EndpointCompany APIlinkedin.company.get(**kwargs)Company Profile EndpointCompany APIlinkedin.person.resolve_by_email(**kwargs)Reverse Work Email Lookup EndpointContact APIlinkedin.person.lookup_email(**kwargs)Work Email Lookup EndpointContact APIlinkedin.person.personal_contact(**kwargs)Personal Contact Number Lookup EndpointContact APIlinkedin.person.personal_email(**kwargs)Personal Email Lookup EndpointContact APIlinkedin.disposable_email(**kwargs)Disposable Email Address Check EndpointContact APIlinkedin.company.find_job(**kwargs)Job Listings EndpointJobs APIlinkedin.job.get(**kwargs)Jobs Profile EndpointJobs APIlinkedin.person.resolve(**kwargs)Person Lookup EndpointPeople APIlinkedin.company.role_lookup(**kwargs)Role Lookup EndpointPeople APIlinkedin.person.get(**kwargs)Person Profile EndpointPeople APIlinkedin.school.get(**kwargs)School Profile EndpointSchool APIlinkedin.company.revealReveal EndpointReveal APIget_balance(**kwargs)View Credit Balance EndpointMeta API