Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for LinkedIn Email Finder API
Jonathan Zihindula
Jonathan Zihindula

Posted on

     

LinkedIn Email Finder API

There are many reasons why you would want to find someone's email address online.
May be you want to reach out, to secure a sale or even propose a partnership.

For This article we are going to find a LinkedIn user's email usingPersonal look up endpoint ofContact API provided by Proxycurl.

Note: Contact API is not intended for front-end use. To avoidcors policy, in this article we are going to use a middleman proxy server.

Content

I. Prerequisite

To follow this article you need to be familiar with javascript ,Node js andexpress.
Plus, you must have a Proxycurl account to get anAPI key.

II. Get a Proxycurl API key

To get a proxycurl API key we need first to create an account ,that is free, in addition Proxycurl will provide 10 free credits that can be used for testing.

II.1. Create Proxycurl account

To create create an account let's go toProxycurl registration page and complete the form.

create account page screenshot

After completing the form click on continue, then confirm the email address.

II.2. Generate Proxycurl API key

After the registration process is well done, login, then clickgenerate Key

generate Proxyurl api key screenshot

III. Proxy server with node.js

Proxy servers act as middlemen, communicating your needs and requests without providing your information to the internet. Proxies can also allow you to bypass certain security blocks and allow you to access information that might otherwise be blocked. This is made possible through use a proxy server that does not reveal your personal IP address.
Find more about proxy server in node jshere.

Now let's go ahead and create our server.
First, we must initialize our project to generate ourpackage.json file:

npminit
Enter fullscreen modeExit fullscreen mode

Next we must install two dependencies:

After, let's create aindex.js andemailFinder.proxy.js file, our project structure looks like:

Project||--- nodes_modules|--- emailFinder.proxy.js|--- index.js|--- package-lock.json|--- package.json
Enter fullscreen modeExit fullscreen mode

Inindex.js let's write the following code:

constexpress=require("express");constapp=express();constPORT=4040;app.listen(PORT,()=>console.log("Proxy is running on PORT"+PORT));
Enter fullscreen modeExit fullscreen mode

Here we are initializing our server withexpress , setting the port on4040.

To get the email from LinkedIn using Proxycurl'sContact API we need :

  • The API endpoint :https://nubela.co/proxycurl/api/contact-api/personal-email
  • The API key that we generated
  • The LinkedIn profile url we want to have the email address

That noted, inemailFinder.proxy.js let's write the following code as well :

constRouter=require("express");const{createProxyMiddleware}=require("http-proxy-middleware");constrouter=Router();constendpoint="https://nubela.co/proxycurl/api/contact-api/personal-email";// API endpointconstapi_key="{api_key}";// proxycurl api_keyconstparams=newURLSearchParams({linkedin_profile_url:"https://www.linkedin.com/in/jonathan-z-0a40ab209",// linkedIn profile url that we're gonna find the email});router.get("/",createProxyMiddleware({target:endpoint+"?"+params,changeOrigin:true,onProxyReq:(proxyReq,req,res)=>{proxyReq.setHeader("Authorization",`Bearer${api_key}`);},}));module.exports=router;
Enter fullscreen modeExit fullscreen mode

Finally , to run our server we need first to import theemailFinder.proxy.js inindex.js and use it as a middleware.

The code inindex.js may look like :

constexpress=require("express");constemailFinderProxy=require("./emailFinder.proxy");constapp=express();app.use("/find/email",emailFinderProxy);constPORT=4040;app.listen(PORT,()=>console.log("Proxy is running on PORT"+PORT));
Enter fullscreen modeExit fullscreen mode

Here we are setting the endpoint that we are going to use in order to fetch the LinkedIn email.

Now the proxy server is ready, let's run it typing in terminal the following command

nodeindex
Enter fullscreen modeExit fullscreen mode

Image description

IV. Fetch LinkedIn email from proxy server.

constenpoint="http://localhost:4040/find/email";fetch(enpoint,{method:"GET",headers:{"Content-Type":"application/json",accept:"application/json",},}).then((res)=>res.json()).then((data)=>console.log(data));
Enter fullscreen modeExit fullscreen mode

This is how the response looks like:

{"emails":["random@gmail.com","random2@yahoo.com"]}
Enter fullscreen modeExit fullscreen mode

Conclusion

Now we can find an email address from LinkedIn with only the LinkedIn profile url.

  • For more details about Proxycurl's services clickhere.

  • Find the full codehere

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Software developer
  • Location
    Kigali Rwanda
  • Joined

More fromJonathan Zihindula

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp