My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
APIDocumentation  
Updated Apr 5, 2010 by jon.cian...@gmail.com

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
qurl 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
Comment by mohomed....@gmail.com, Mar 31, 2011

When convert timestamp field returns an invalid year

Comment by ar.peral...@gmail.com, Apr 20, 2011

multiply the timestamp by 1000

Comment by spaced...@gmail.com, May 11, 2011

Exclude URLs, how to?

Comment by jehugale...@gmail.com, May 13, 2011

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?

Comment by rahul.ag...@gmail.com, May 31, 2011

This is the poorest documentation i have ever seen. there is no mention of how to use phrases, exclude keywords..

Comment by timmytom...@gmail.com, Jun 13, 2011

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?

Comment by SumitSa...@gmail.com, Jul 1, 2011

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

Comment by neeraj.d...@gmail.com, Aug 9, 2011

How to get Social mention API? I am not able to locate it.

Please help anyone!!!

Comment by linoleum...@gmail.com, Aug 9, 2011

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

Comment by TNSMai...@gmail.com, Nov 2, 2011

what is the datatype and the character limit for the description field returned?

Comment by n...@epiclabs.com, Nov 17, 2011

Is there a list of valid sources?

Comment by ezequiel...@gmail.com, Nov 25, 2011

Is there a list of valid metadata? (is the only meta value 'top'?) thanks!

Comment by rohitkad...@gmail.com, Mar 12, 2012

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.....

Comment by r.soumya...@gmail.com, Apr 16, 2012

How can fetch data for a particular date? tspan= only fetches the last 'x' hours/days/weeks.

Comment by max.shar...@impactdata.com.au, May 22 (4 days ago)

This is the worst documentation for a paid API service I have ever seen.

Please list the options available for src parameter.

Comment by davide.m...@gmail.com, May 23 (4 days ago)

I'm getting a request timed out when just using the example. Do I need an API key for free usage as well?

Comment by peter.ki...@gravitatedesign.com, May 24 (3 days ago)

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.


Sign in to add a comment
Powered by Google Project Hosting