Social Media Profiling

Get the number of followers and account information of multiple social media platforms from individual email addresses. If the social media information for a specific email address aren't fetched yet the request will be queued and the data will be available within the next 12 hours. Please consider that the response of a social media platform may be empty because of restricted access (privacy setting of the person being checked). The following social media platforms are currently checked:

  • LinkedIn
  • XING
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • Youtube
  • Google Plus
  • Klout

Request Url: https://api.datamill.solutions/social-media/activities/get
Request Method: POST

Table of Contents

Request Parameters

The API uses the POST request method to send data in the HTTP message body to avoid data being stored in the cache of the web server. A request is valid if all parameters are provided as described below (data type, minimum and maximum length). Please note that all data must be UTF-8 and URL encoded.

POST /social-media/activities/get HTTP/1.1
Host: https://api.datamill.solutions

name1=value1&name2=value2
Parameter Mandatory Data Type Min. Max. Description
license required string 29 29 Your license key used for authentication - keep this key secret!
guid required string 30 40 Your GUID used for authentication - keep this key secret!
email required string 1 320 The person's email address being checked on all social media platforms

Response

The API returns all data in valid JSON. A few programming languages include native support for JSON. For those that don't, you can find a suitable library at http://www.json.org. Valid requests always returns all response keys listed below. Depending on the request parameters some response keys may be empty.

HTTP/1.1 200 OK

Server: Apache
Content-Type: application/json; charset=UTF-8
Date: Tue, 22 Oct 2019 13:01:41 GMT
Content-Length: 33
Access-Control-Allow-Origin: *

{"key1":"value1","key2":"value2"}
Name Data Type Description
status integer Unique status code describing the response
  • 1: Social media activities found and present in the response
  • -1: No social media activities found for the requested email address (in this case all following response keys except the status_description are not present)
  • -2: Your requested is queued and a response will be available within the next 12 hours (in this case all following response keys except the status_description are not present)
status_description string Short description of the status code
name string First name and last name of the person
email string The requested email address
gender string The person's gender written in english and all lowercase. Either: female or male
avatar string Profile image (fully qualified url) of the social media profile with the most followers
bio string Biography of the social media profile where the person has the most followers (unless it doesn't show a biography, then the social media profile with the second most followers is checked)
max_followers integer The maximum number of followers found by any of the social media platforms
sum_followers integer The total number of followers of all social media platforms
location array Collection of information about the geo-location the person lives in. The collection contains of the following keys:
  • display_name: Single line address of all address parts found by all social media platforms
education array Collection of all educations found. Each element of the collection is an array containing the following keys:
  • university: The University's name
  • major: The major focus of the education
  • start_date: Either year and month or year only when the education started
  • end_date: Either year and month or year only when the education ended
employment array Collection of all companies the person worked for. Each element of the collection is an array containing the following keys:
  • company: The company's name
  • title: The business title / position the person had in this company
  • start_date: Either year and month or year only when the person started to work for this company
  • end_date: Either year and month or year only when the person ended to work for this company. The key does not exist if the person still works for this company
  • current: Flag (0 or 1) if the person still works for this company
linkedin array Collection of all information found on LinkedIn. This key only exists if information were found. The collection contains the following keys:
  • url: The fully qualified url to the person's profile
  • bio: The person's biography written on LinkedIn
  • followers: The number of followers on LinkedIn
xing array Collection of all information found on XING. This key only exists if information were found. The collection contains the following keys:
  • url: The fully qualified url to the person's profile
  • followers: The number of followers on XING
facebook array Collection of all information found on facebook. This key only exists if information were found. Due to access restrictions the collection currently contains only the following key:
  • url: The fully qualified url to the person's profile
twitter array Collection of all information found on twitter. This key only exists if information were found. The collection contains the following keys:
  • url: The fully qualified url to the person's profile
  • bio: The person's biography written on twitter
  • followers: The number of followers on twitter
  • posts: The number of posts (tweets) on twitter
  • engagement: The number of engagements (retweets and likes) on twitter
  • engagement_percent: The percentage of engagements (retweets and likes) relative to the number of followers on twitter
pinterest array Collection of all information found on Pinterest. This key only exists if information were found. The collection contains the following keys:
  • url: The fully qualified url to the person's profile
  • bio: The person's biography written on Pinterest
  • followers: The number of followers on Pinterest
instagram array Collection of all information found on Instagram. This key only exists if information were found. The collection contains the following keys:
  • url: The fully qualified url to the person's profile
  • bio: The person's biography written on Instagram
  • followers: The number of followers on Instagram
  • is_private: Flag if the profile is in private mode (1) or published (0)
  • posts: The number of posts on Instagram
  • engagement: The number of engagements (likes) on Instagram
  • engagement_percent: The percentage of engagements (likes) relative to the number of followers on Instagram
youtube array Collection of all information found on Youtube. This key only exists if information were found. The collection contains the following keys:
  • url: The fully qualified url to the person's profile
  • followers: The number of followers on Youtube
  • posts: The number of posts (published videos) on Youtube
  • engagement: The number of engagements (likes and comments) on Youtube
  • engagement_percent: The percentage of engagements (likes and comments) relative to the number of followers on Youtube
googleplus array Collection of all information found on Google Plus. This key only exists if information were found. The collection contains the following keys:
  • url: The fully qualified url to the person's profile
  • followers: The number of followers on Google Plus
klout array Collection of all information found on Klout. This key only exists if information were found. The collection contains the following keys:
  • url: The fully qualified url to the person's profile
  • score: The internal score of Klout

Response Errors

If the request fails the API returns a HTTP status code according to the reason. A reason may be a missing mandatory request parameter, invalid parameter credentials (minimum/maximum length) or invalid API keys. The response body is a valid JSON containing detail information about the reason (except for status code 500).

HTTP/1.1 404 Not Found

Server: Apache
Content-Type: application/json; charset=UTF-8
Date: Tue, 22 Oct 2019 13:01:41 GMT
Content-Length: 71
Access-Control-Allow-Origin: *

{"errorcode":404,"errormessage":"transformation function name invalid"}
HTTP Status Code Reason
401 Unauthorized
The license key and/or GUID key is missing, invalid or inactive.
402 Payment Required
Your /data.mill credit quota is exceeded. You need to get more credits.
403 Forbidden
You need to accept all required agreements of this function to be able to use it.
404 Not Found
The request path in combination with the request method does not exist.
405 Method Not Allowed
The request method is not allowed for the requested path.
412 Precondition Failed
At least one of the given request parameter has invalid credentials (e.g. data type, length).
428 Precondition Required
At least one of the mandatory request parameter is missing or has an empty value.
500 Internal Server Error
An unexpected condition terminated the request.
503 Service Unavailable
The service is currently in maintenance mode and will be alive later.

Batch Mode

The batch mode allows the execution of thousands of records (limited to 5,000) combined in a single request. This API endpoint as described above uses the single mode execution of records. To use the batch mode you need to combine all request parameters above (excluding license and guid) as array, where each array element represents a single record. This array is converted to a valid JSON string and set as value of the new request parameter called batch. The response of the batch mode is a valid JSON which contains the result for each record set in the request. The response keys of each result element are the same as for the single request mode described above.

Batch Request

license=...
&guid=...
&batch=[{"email":"..."},{"email":"..."}]

Batch Response

[{"status":"...","status_description":"...","name":"...","email":"...","gender":"...","avatar":"...","bio":"...","max_followers":"...","sum_followers":"...","location":[],"education":[],"employment":[],"linkedin":[],"xing":[],"facebook":[],"twitter":[],"pinterest":[],"instagram":[],"youtube":[],"googleplus":[],"klout":[]},{"status":"...","status_description":"...","name":"...","email":"...","gender":"...","avatar":"...","bio":"...","max_followers":"...","sum_followers":"...","location":[],"education":[],"employment":[],"linkedin":[],"xing":[],"facebook":[],"twitter":[],"pinterest":[],"instagram":[],"youtube":[],"googleplus":[],"klout":[]}]

Code Snippets

We provide some code snippets for multiple programming languages to easily implement this function in your own application. The code snippets below uses the single request mode. If you want to use the batch mode instead of the single mode you need to modify the snippet. Feel free to copy the code snippets for your preferred programming language.

// the following code requires cURL php extension installed on your server (http://php.net/manual/en/book.curl.php) // initialize a new cURL session and store the cURL handler object $curl = curl_init(); // set the url to which the request will be sent curl_setopt($curl, CURLOPT_URL, "https://api.datamill.solutions/social-media/activities/get"); // set the HTTP method to use for the request curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); // set the number of parameters to be sent to the server curl_setopt($curl, CURLOPT_POST, 3); // data to be sent to the server // TODO: append your API keys and value(s) and don't forget to urlencode() them curl_setopt($curl, CURLOPT_POSTFIELDS, "license=&guid=&email="); // set a timeout in seconds for the request curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($curl, CURLOPT_TIMEOUT, 10); // return the raw data from the server curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // execute the previously created cURL session $responseString = curl_exec($curl); // close the cURL session after execution curl_close($curl); // convert the response (string) to an array $responseArray = json_decode($responseString, true); // TODO: process the data in the response array (you may process the data in the response string too)
/* Note: We highly recommend to NOT use this code as it is written here. If you choose JavaScript as your preferred programming language, please change the following code to request your own server (without API keys) and further redirect the request from your own server to the API including your API keys. Otherwise everyone will be able to read your API keys and use them for their own purpose! */ // the following code requires jQuery JavaScript library (minimum version 1.8.1) added to your website (http://jquery.com/download/) // perform an asynchronous HTTP (Ajax) request jQuery.ajax({
// set the url to which the request is sent url : "https://api.datamill.solutions/social-media/activities/get", // set the HTTP method to use for the request type: "POST", // data to be sent to the server (you may use a JavaScript object instead of a string) // TODO: append your API keys and value(s) and don't forget to urlencode() them data : "license=&guid=&email=", // type of data that we are expecting back from the server dataType: "JSON", // set a timeout in milliseconds for the request timeout: 10000, // function to be called if the request succeeds success:function(data, textStatus, jqXHR) {
// {object} data The data returned from the server, formatted according to the dataType parameter. // {string} textStatus String describing the status. // {object} jqXHR A XMLHttpRequest object describing the response. // TODO: process the data in the 'data' JavaScript object
}, // function to be called if the request fails error: function(jqXHR, textStatus, errorThrown) {
// {object} jqXHR A XMLHttpRequest object describing the response. // {string} textStatus String describing the type of error occurred. // {string} errorThrown Text portion of the HTTP status, such as "Not Found" or "Internal Server Error". // TODO: process the error occurred
}
});
// the following code uses standard libraries included in Microsoft Visual Studio 2013 or higher using System.IO; using System.Web; using System.Net;
// create an array of bytes representing the data to be sent to the server // TODO: append your API keys and value(s) and don't forget to urlencode() them byte[] Data = Encoding.ASCII.GetBytes("license=&guid=&email="); // create a new web request resource and set the url to which the request is sent HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("https://api.datamill.solutions/social-media/activities/get"); // set the HTTP method to use for the request Request.Method = "POST"; // set the request content type Request.ContentType = "application/x-www-form-urlencoded"; // set the number of bytes being sent to the server Request.ContentLength = Data.Length; // set a timeout in milliseconds for the request Request.Timeout = 10000; // try to send all data to the newly created web request resource try {
using(var Stream = Request.GetRequestStream()) {
Stream.Write(Data, 0, Data.Length);
}
} catch (Exception ex) {
// TODO: process the exception thrown (e.g. url not found) return;
} // try to read the response from the web resource try {
HttpWebResponse ResponseObject = (HttpWebResponse)Request.GetResponse(); StreamReader Reader = new StreamReader(ResponseObject.GetResponseStream()); // read the whole response as string and store it String ResponseMessage = System.Net.WebUtility.HtmlDecode(Reader.ReadToEnd()); // TODO: process the data in 'ResponseMessage'
} catch (WebException ex) {
// error occurred, http status code != 200 (e.g. timeout or parameter invalid) if(ex.Status == WebExceptionStatus.Timeout) {
// TODO: process the timeout reached
} else {
// read the response from the web exception HttpWebResponse ResponseObject = (HttpWebResponse)ex.Response; StreamReader Reader = new StreamReader(ResponseObject.GetResponseStream()); // read the whole response as string and store it String ResponseMessage = System.Net.WebUtility.HtmlDecode(Reader.ReadToEnd()); // TODO: process the error response received from the server (stored in 'ResponseMessage')
}
}
// the following code requires at least Android API version 10 // import standard Java and Android libraries import java.util.List; import org.apache.http.NameValuePair; import java.util.ArrayList; import org.apache.http.message.BasicNameValuePair; import java.net.URLDecoder; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.DefaultHttpClient;
// create a list of key-value-pairs to store the data which will be sent to the server List<NameValuePair> dataPairs = new ArrayList<NameValuePair>(); // add each parameter to the key-value-pair list (value is decoded to UTF-8 standard) // TODO: append your API keys and value(s) dataPairs.add(new BasicNameValuePair("license", URLDecoder.decode("enter value here", "UTF-8"))); dataPairs.add(new BasicNameValuePair("guid", URLDecoder.decode("enter value here", "UTF-8"))); dataPairs.add(new BasicNameValuePair("email", URLDecoder.decode("enter value here", "UTF-8"))); // create the web resource with pre-defined POST method and set the url to which the request is sent HttpPost request = new HttpPost("https://api.datamill.solutions/social-media/activities/get"); // append the parameters to the web resource request.setEntity(new UrlEncodedFormEntity(dataPairs)); try {
// execute the request and read the response string HttpClient client = new DefaultHttpClient(); String response = client.execute(request); // TODO: process the data in 'response'
} catch (IOException ex) {
// TODO: process the exception thrown
}

Try it right now!

Enter some example data to test the result of the API.

Need help?

If you have any questions about the implementation of this API or found an error please don't hesitate to contact our support team.