# Profile URL to Work Email V2

{% tabs %}
{% tab title="Curl" %}

```sh
cURL 'https://api.enrich.so/v2/api/linkedin-to-email?linkedin_profile=https://www.linkedin.com/in/williamhgates'
--header 'Authorization: Bearer <token>'
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const axios = require('axios');

axios.get('https://api.enrich.so/v2/api/linkedin-to-email?linkedin_profile=https://www.linkedin.com/in/williamhgates', {
    headers: {accept: 'application/json', Authorization: 'Bearer <token>'}
})
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.log(error);
  });
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.enrich.so/v2/api/linkedin-to-email?linkedin_profile=https://www.linkedin.com/in/williamhgates")
  .get()
  .addHeader("accept", "application/json")
  .addHeader("authorization", "Bearer <token>")
  .build();

Response response = client.newCall(request).execute();

```

{% endtab %}

{% tab title="Python" %}

```python
import requests
payload = {'linkedin_profile':'https://www.linkedin.com/in/williamhgates' }
headers = {'accept': 'application/json', 'authorization': 'Bearer <token>'}
resp = requests.get('https://api.enrich.so/v2/api/linkedin-to-email', params=payload, headers=headers)
print (resp.text)
```

{% endtab %}

{% tab title="Php" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.enrich.so/v2/api/linkedin-to-email?linkedin_profile=https://www.linkedin.com/in/williamhgates",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "accept: application/json",
    "authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.enrich.so/v2/api/linkedin-to-email?linkedin_profile=https://www.linkedin.com/in/williamhgates")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
This API is an asynchronous endpoint that may return a **status code** **202** in case the request is taking longer to process, indicating that the request has been accepted and the client should retry the same payload after a short delay, as specified in the response message.
{% endhint %}

## Example response

#### Status Code: <mark style="color:orange;">202 ACCEPTED</mark>

```json
{
    "status": "in_progress",
    "message": "Your request has been queued. Please try again later"
}
```

#### Status Code: <mark style="color:green;">200 OK</mark>

```json
{
    "email": "username.lastname@example.com",
    "found": true,
    "total_credits": 25000,
    "credits_used": 229,
    "credits_remaining": 24771
}
```

#### Status code: <mark style="color:red;">404 NOT FOUND</mark>

```json
{
    "error": true,
    "message": "Sorry we couldn't find the email for https://www.linkedin.com/in/williamhgates"
}
```
