Company Profile Lightning Component using FullContact API

Hello Guys,

In this post I am going to share a lightning component that displays the company profile/social profile based on the website (URL). This lightning component uses “FullContact API” to display the company profile.

This lightning component can be used on the Account detail page : It will display the company logo, overview, founded year, number of employees, phone, email, social media profile, addresses, ranking, etc. These information can be used by sales and marketing people for their operations.

FullContact REST API used to fetch the company information based on the website(domain).

Find the component code below OR here:


<aura:component controller="FullContactAccountDetailsContrl" implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId" Access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="photo" type="string"/>
<aura:attribute name="details" type="object"/>
<aura:attribute name="err" type="string"/>
<div id="content">
<div class="slds">
<aura:if isTrue="{!v.err !=''}">
<aura:set attribute="else">
<table class="slds-table slds-table--bordered" style="table-layout: fixed; width: 100%; ">
<td><img src="{!v.details.logo}" width="110" height="110" style=" "></img></td>
<td> <b>{!}</b></td>
<td id="overview">
<aura:iteration items="{!v.details.organization.contactInfo.phoneNumbers}" var="c">
<aura:iteration items="{!v.details.organization.contactInfo.emailAddresses}" var="c">
<aura:iteration items="{!v.details.socialProfiles}" var="s">
<td >{!s.typeName}</td>
<td> <a href="{!s.url}" target="_blank" > {!s.typeName} Profile</a>
<td id="Addresses">{!v.details.organization.contactInfo.addresses[0].addressLine1},
<td>Ranking: </td>
<td>{!v.details.traffic.ranking[0].rank} ({!v.details.traffic.ranking[0].locale})</td>
view raw companyProfile hosted with ❤ by GitHub


doInit : function(component, event, helper) {


fetchCompanyProfile : function(component,event,helper) {
var action=component.get("c.getAccountDetails");
"rec_id": component.get("v.recordId")
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
if(response.getReturnValue() == 'Enter website to see the company profile'){
component.set("v.err",'Enter website to see the company profile');
var data = JSON.parse(response.getReturnValue());
view raw companyProfileHelper hosted with ❤ by GitHub


.THIS #overview{
word-wrap: break-word;
white-space: pre-wrap;
.THIS #Addresses{
word-wrap: break-word;
white-space: inherit;
view raw companyProfileCSS hosted with ❤ by GitHub


public class FullContactAccountDetailsContrl {
public static string getAccountDetails(string rec_id){
String msg = '';
Account acc=[select Website from account where id=:rec_id ];
system.debug('domain : '+ acc.Website);
if(acc.Website != null && acc.Website != ''){
string baseURL = ';;
string apikey = '9e340d31aXXXXXXX'; // Your API Key (Register on to get API Key)
string url = baseURL +'='+ acc.Website + '&apiKey=' + apikey;
HttpRequest req = new HttpRequest();
Http http = new Http();
HttpResponse res = http.send(req);
system.debug('response status code: '+res.getStatusCode());
string body=res.getBody();
system.debug('Retured Body: '+body);
if (res.getStatusCode() == 200) {
return res.getBody();
return null;
return 'Enter website to see the company profile';
catch(Exception e){
return null;

Now add this component on the Account detail page and make sure the website field is not blank.


Register here and get API KEY:


Arun Kumar

One comment

  1. Thank you for so much Arun for this Blog. I have the same scenario and used your code. I have created an account on as well. When I am trying to execute the code I am getting error: “message”:”Passing API key in request URL not allowed”.

    Please help on this issue if you also face any thing like this.

    Looking forward to your response.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s