The Social Analytics API let you directly access social media data for either of the topics in the Social Analytics lab. After
requesting access to one of the Social Analytics topics here, you can access data by one of the following methods:
1. Open a PowerPivot window and select "From Azure DataMarket" in the Get External Data menu.
2. Use the appropriate URL for your Social Media dataset:
4. Click Next to load a list of tables and views.
5. Select the item(s) that you want to import and click "Finish" to start downloading data.
1. Click "Add connection"
2. Select "Microsoft DataMarket Service" and click Next
3. Use the approriate URL for your Social Media dataset:
4. Click "Ok" to load the data into LinqPad. Once the tables and views are loaded you can begin creating queries.
Sample Code for Visual Studio
Here is an example of code that you can paste into Visual Studio and modify to suit your needs.
- Create a new project in Visual Studio
- Select "Visual C#" as the language and "Console Application" as the project template.
- In the "Name:" field enter "SocialAnalyticsExample"
- Click "OK"
- Create a new Service Reference
- Copy and paste the sample code into Program.cs (replacing everything that was there)
- Replace the "" string with your Live ID Replace the "" string with your Account Key (not your Live ID password)
//Social Analytics API
//Sample code to call REST based Social Analytics API
//Set the REST based URL
string url = "https://api.datamarket.azure.com/Vancouver/VancouverBillGates/ Filters()?$top=10";
//Create httpweb request and set the method
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "GET";
//Call DataMarket basic authentication
request.Credentials = new NetworkCredential("DATAMARKET_USER", "ACCOUNT_KEY");
//Get the response back
using (WebResponse response = request.GetResponse())
HttpWebResponse res = (HttpWebResponse)response;
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
//Display the response
// Additional Samples
//1. To retrieve top 5 keywords for last 30 days for particular filter, you use the following URL & specify the filterID you want:
//2. To retrieve top 5 sites for last 30 days for particular filter, you use the following URL & specify the FilterID you want:
For more information about our API and code samples, see the
Social Analytics Lab API Documentation.