Social Mention API Documentation
Social Mention provides an API for developers query for social media search results in several different formats.
Search API
The search API provides a single stream of real-time search data aggregated from numerous social media properties. It is available in several formats.
Base URL prefix:
http://socialmention.com/search
REST Parameters:
| Parameter | Description |
| q | url encoded query terms (can include exception ex: "iphone apps -blackberry") |
| f | response format (json, php, xml, rss, csv) |
| t[] | search type (blogs, microblogs, bookmarks, comments, events, images, news, videos, audio, questions, networks, all), can use multiple ex: http://socialmention.com/search?q=iphone&t[]=blogs&t[]=microblogs |
| src[] | (optional) specific social media sources (ex: http://socialmention.com/search?q=iphone&src[]=twitter&t[]=youtube) |
| lang | (optional) 2 letter ISO 639-1 language code (if null - source default language will be returned |
| strict | (default true) disable strict mode, which will not query sources that do not support the language param (true, false) |
| l | location string (city and state/province). Required if search type is "events" |
| callback | (optional) required for JSONP compatible requests |
| key | (optional) required for commercial requests |
| from_ts | (optional) remove results older than the supplied number of seconds, ex: to remove results older than 1 day &from_ts=86400 |
| meta[] | (optional) meta data to include, ex: &meta=top |
Example:
http://socialmention.com/search?q=iphone+apps&f=json&t=microblogs&lang=fr
Response Properties
The search API will return the following properties for JSON, PHP, and XML response formats. NOTE: Not all metadata is available for every item.
- title - title of search
- timestamp - search timestamp
- count - number of items
- items (array)
- id - unique hash id based on url (datatype INT 20)
- title
- description
- link
- timestamp
- language - language code
- image - story or item image
- embed - video embed script
- user - author's username
- user_image - author's profile image
- user_link - author's profile url
- domain - the original source's domain
- source - the original source's name
- favicon - the original source's favicon
- type - mention type, ie: blogs, microblogs, comments etc.
Additional item properties (available to commercial API users):
- sentiment - positive or negative integer score, ex: -1, 0, +8 etc.
- retweet - is mention a retweet, boolean, ex: "RT @..."
- urls_cited - number of links in mention
- hashtags - number of hashtags in mention, ex: "... #hashtag"
- references - number of @references in mention
- top_users - array of top users by activity
- top_hashtags - array of top hashtags
- top_keywords - array of top keywords
When convert timestamp field returns an invalid year
multiply the timestamp by 1000
Exclude URLs, how to?
I see tspan=24h and other parameters being used. If these are valid query parameters, could you update the docs?
Also, can you explain how to pass the API key securely?
This is the poorest documentation i have ever seen. there is no mention of how to use phrases, exclude keywords..
I want to give you money!; as in pay for a commercial subscription. That being said, it would be nice if there were actually a link or a buy now page or anything. how hard is it to use paypal and an ecommerce package so we could all just purchase the services like anything else online. add to cart button! ever heard of it?
I love this. This is what exactly I am looking for. Is it possible to know the commercials. Please email me @ sumit_kute@yahoo.com
How to get Social mention API? I am not able to locate it.
Please help anyone!!!
how to get the api? you only need a structure like the example (http://socialmention.com/search?q=iphone+apps&f=json&t=microblogs&lang=fr) and you can get the response properties to do anything you want with that, right now I'm using xml as a response format
what is the datatype and the character limit for the description field returned?
Is there a list of valid sources?
Is there a list of valid metadata? (is the only meta value 'top'?) thanks!
I need to convert timestamp into DateTime? in C#.. HELP!!!! I got time stamp value through API like 1331554362.... How could I convert this to Date Time or please give me its unit.....
How can fetch data for a particular date? tspan= only fetches the last 'x' hours/days/weeks.
This is the worst documentation for a paid API service I have ever seen.
Please list the options available for src parameter.
I'm getting a request timed out when just using the example. Do I need an API key for free usage as well?
David,
Try setting the request URL to 'api2.socialmention.com/search?...'
I had the same issue when I set the base URL to 'socialmention.com/search?...' There is a 302 redirect. It works in a browser because it follows the redirect, but in python HTTPlib for example, 302 redirects are not followed and a possible timeout may result.
Also, if you are using something like URLLib2 or equivalent, try changing the default timeout time to something higher. Requests to the socialmention API take a while to return data.