API
Positionizer provides an easy Application Programming interface. The output will be encoded in JSON.
Basic Request Syntax:
http://www.positionizer.com/positionize?url=[url]&queries=[queries]
Required Parameters:
- [url] - the URL without "http://", for example "positionizer.com"
- [queries] - comma separated queries
Optional Parameters:
- [country] - localize search-engines. Allowed country codes are: "us", "de", "br", "uk", "fr", "it", "ru", "ca", "es", "au". Default value: "us".
- [engine] - specify which search-engine should be queried. At the moment Positionizer supports only Google and Yahoo. There will be more soon. Allowed values are: "google", "yahoo", "all". Default value: "all".
Please note: Positionizer loads the first 100 hits of every requested search-engine for every query you entered. That means you might have to be patient until an output gets generated, if you make a request with loads of queries. Server-timeout is set to 30 seconds.
Output Syntax:
{ [[search-engine1]] : {
[[query1]] : {
[[position]] : [[found-url]],
[[position]] : [[found-url]],
[[position]] : [[found-url]],
...
},
[[query2]] : {
[[position]] : [[found-url]],
...
},
...
}, [[search-engine2]] : {
[[query1]] : [],
[[query2]] : {
[[position]] : [[found-url]],
...
},
...
}}
If the requested URL isn't featured on the first 100 results, an empty array will be returned (see search-engine2 query1 above).
Examples:
Example Request 1:
http://www.positionizer.com/positionize?url=www.nytimes.com&queries=new+york+times,usa+breaking+news,lolcats&engine=google
Output:
{ 'google' : {
'new york times' : {
1 : 'http://www.nytimes.com/',
2 : 'http://nytimes.com/pages/todayspaper/index.html'
},
'usa breaking news' : {
4 : 'http://www.nytimes.com/',
5 : 'http://www.nytimes.com/pages/'
},
'lolcats' : []
}}
This means positionizer found www.nytimes.com with the query "new york times" on position 1 (with URL http://www.nytimes.com/) and position 2 (with URL http://www.nytimes.com/pages/todayspaper/index.html). When Google gets queried with "usa breaking news", www.nytimes.com appears on position 4 (with URL http://www.nytimes.com/) and 5 (with URL http://www.nytimes.com/pages/). The value associated with the query "lolcats" is empty. This means www.nytimes.com hasn't appeared in the first 100 results Google generated when asked for "lolcats".
Example Request 2:
http://www.positionizer.com/positionize?url=omsn.de&queries=omsn,challenging+reality&country=de
Output:
{ 'google' : {
'omsn' : {
1 : 'http://www.omsn.de/',
2 : 'http://www.omsn.de/news/omsn-v2/'
},
'challenging reality' : {
10 : 'http://www.omsn.de/',
11 : 'http://www.omsn.de/news/cape-town/'
},
}, 'yahoo' : {
'omsn' : {
1 : 'http://www.omsn.de/',
2 : 'http://www.omsn.de/news/'
},
'challenging reality' : {
3 : 'http://www.omsn.de/',
4 : 'http://www.omsn.de/news/page/5'
}
}}
At german Google and german Yahoo omsn.de appears at the first two positions, when asked for "omsn". If queried with "challenging reality" omsn.de appears at german Google on position 10 and 11, at german Yahoo on position 3, 4.
Enjoy using Positionizer's API. If you still have any questions or if you have noticed a bug, feel free to contact us.