Google Reader API for Search

Get SID

POST https://www.google.com/accounts/ClientLoginResponse
FORM:
  • service=reader
  • Email={loginEmail}
  • Passwd={loginPassowrd}
HTTP Resonse:
  • SID=…\n
  • LSID=…\n
  • Auth=…\n

Get Token for later operations

GET http://www.google.com/reader/api/0/token
    Add Extra HTTP Header for getting Token and other operations
        1. Cookie: SID={SID from ClientLogin}
        2. Authorization: GoogleLogin auth={Auth from ClientLogin}  

All {keyword} are encoded in UTF-8 with application/x-www-form-urlencoded format

Search Reader with <keyword>

# Get search result item index
GET  http://www.google.com/reader/api/0/search/items/ids?q={keyword}&num=1000&output=json&ck={timestamp}&client=scroll

HTTP Response:
JSON ["results"] -> [{"id":item index}, {"id":item index}, .....]

# Get search result item content
POST http://www.google.com /reader/api/0/stream/items/contents?ck={timestamp}&client=scroll
POST FORM:
  • i=item index
  • it=0
  • T=Token 

Search Reader with <keywords> <Feed>

GET /reader/api/0/search/items/ids?q={keyword}&num=1000&s=feed/{feed url}&output=json&ck={timestamp}&client=scroll

POST /reader/api/0/stream/items/contents?ck={timestamp}&client=scroll


Search Reader with <keywords> <folder>

GET http://www.google.com/reader/api/0/search/items/ids?q={keyword}&num=1000&s={folder}&output=json&ck={timestamp}&client=scroll

POST http://www.google.com /reader/api/0/stream/items/contents?ck={timestamp}&client=scroll


Feed listing

GET http://www.google.com/reader/api/0/stream/contents/feed/{feed url}?

  • ot=[unix timestamp] : The time from which you want to retrieve items. Only items that have been crawled by Google Reader after this time will be returned.
  • r=[d|n|o] : Sort order of item results. d or n gives items in descending date order, o in ascending order.
  • xt=[exclude target] : Used to exclude certain items from the feed. For example, using xt=user/-/state/com.google/read will exclude items that the current user has marked as read, or xt=feed/[feedurl] will exclude items from a particular feed (obviously not useful in this request, but xt appears in other listing requests).
  • n=[integer] : The maximum number of results to return.
  • ck=[unix timestamp] : Use the current Unix time here, helps Google with caching.
  • client=[your client] : You can use the default Google client (scroll), but it doesn't seem to make a difference. Google probably uses this field to gather data on who is accessing the API, so I'd advise using your own unique string to identify your software.

Reference:

沒有留言:

張貼留言