
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 avoid
cors
policy, in this article we are going to use a middleman proxy server.
Content
- Prerequisite
- Get a Proxycurl API key
- Proxy server with node.js
- Fetch LinkedIn email from proxy server
- Conclusion
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.
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
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
Next we must install two dependencies:
express
http-proxy-middleware
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
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));
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;
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));
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
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));
This is how the response looks like:
{"emails":["random@gmail.com","random2@yahoo.com"]}
Conclusion
Now we can find an email address from LinkedIn with only the LinkedIn profile url.
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse