<p>Does Google Reader have an API and if so, how can I get the count of the number of unread posts for a specific user knowing their username and password?</p>

[{'answer_id': 52886, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 4, 'selected': False, 'text': '<p>It is <a href="http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI" rel="nofollow noreferrer">there</a>. Still in Beta though.</p>\n'}, {'answer_id': 582108, 'author': 'jimmyorr', 'author_id': 19239, 'author_profile': 'https://Stackoverflow.com/users/19239', 'pm_score': 7, 'selected': True, 'text': '<p>This URL will give you a count of unread posts per feed.  You can then iterate over the feeds and sum up the counts.</p>\n\n<p><a href="http://www.google.com/reader/api/0/unread-count?all=true" rel="nofollow noreferrer">http://www.google.com/reader/api/0/unread-count?all=true</a></p>\n\n<p>Here is a minimalist example in Python...parsing the xml/json and summing the counts is left as an exercise for the reader:</p>\n\n<pre class="lang-py prettyprint-override"><code>import urllib\nimport urllib2\n\nusername = \'username@gmail.com\'\npassword = \'******\'\n\n# Authenticate to obtain SID\nauth_url = \'https://www.google.com/accounts/ClientLogin\'\nauth_req_data = urllib.urlencode({\'Email\': username,\n                                  \'Passwd\': password,\n                                  \'service\': \'reader\'})\nauth_req = urllib2.Request(auth_url, data=auth_req_data)\nauth_resp = urllib2.urlopen(auth_req)\nauth_resp_content = auth_resp.read()\nauth_resp_dict = dict(x.split(\'=\') for x in auth_resp_content.split(\'\\n\') if x)\nauth_token = auth_resp_dict["Auth"]\n\n# Create a cookie in the header using the SID \nheader = {}\nheader[\'Authorization\'] = \'GoogleLogin auth=%s\' % auth_token\n\nreader_base_url = \'http://www.google.com/reader/api/0/unread-count?%s\'\nreader_req_data = urllib.urlencode({\'all\': \'true\',\n                                    \'output\': \'xml\'})\nreader_url = reader_base_url % (reader_req_data)\nreader_req = urllib2.Request(reader_url, None, header)\nreader_resp = urllib2.urlopen(reader_req)\nreader_resp_content = reader_resp.read()\n\nprint reader_resp_content\n</code></pre>\n\n<p>And some additional links on the topic:</p>\n\n<ul>\n<li><a href="http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI" rel="nofollow noreferrer">http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI</a></li>\n<li><a href="https://stackoverflow.com/questions/101742/how-do-you-access-an-authenticated-google-app-engine-service-from-a-non-web-pyt">How do you access an authenticated Google App Engine service from a (non-web) python client?</a></li>\n<li><a href="http://blog.gpowered.net/2007/08/google-reader-api-functions.html" rel="nofollow noreferrer">http://blog.gpowered.net/2007/08/google-reader-api-functions.html</a></li>\n</ul>\n'}, {'answer_id': 2594683, 'author': 'yassin', 'author_id': 256763, 'author_profile': 'https://Stackoverflow.com/users/256763', 'pm_score': 0, 'selected': False, 'text': '<p>In the API posted in [1], the "token" field should be "T"</p>\n\n<p>[1] <a href="http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI" rel="nofollow noreferrer">http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI</a></p>\n'}, {'answer_id': 3517599, 'author': 'livibetter', 'author_id': 242583, 'author_profile': 'https://Stackoverflow.com/users/242583', 'pm_score': 3, 'selected': False, 'text': '<p>Here is an update to <a href="https://stackoverflow.com/questions/52880/google-reader-api-unread-count/582108#582108">this answer</a></p>\n\n<pre><code>import urllib\nimport urllib2\n\nusername = \'username@gmail.com\'\npassword = \'******\'\n\n# Authenticate to obtain Auth\nauth_url = \'https://www.google.com/accounts/ClientLogin\'\n#auth_req_data = urllib.urlencode({\'Email\': username,\n#                                  \'Passwd\': password})\nauth_req_data = urllib.urlencode({\'Email\': username,\n                                  \'Passwd\': password,\n                                  \'service\': \'reader\'})\nauth_req = urllib2.Request(auth_url, data=auth_req_data)\nauth_resp = urllib2.urlopen(auth_req)\nauth_resp_content = auth_resp.read()\nauth_resp_dict = dict(x.split(\'=\') for x in auth_resp_content.split(\'\\n\') if x)\n# SID = auth_resp_dict["SID"]\nAUTH = auth_resp_dict["Auth"]\n\n# Create a cookie in the header using the Auth\nheader = {}\n#header[\'Cookie\'] = \'Name=SID;SID=%s;Domain=.google.com;Path=/;Expires=160000000000\' % SID\nheader[\'Authorization\'] = \'GoogleLogin auth=%s\' % AUTH\n\nreader_base_url = \'http://www.google.com/reader/api/0/unread-count?%s\'\nreader_req_data = urllib.urlencode({\'all\': \'true\',\n                                    \'output\': \'xml\'})\nreader_url = reader_base_url % (reader_req_data)\nreader_req = urllib2.Request(reader_url, None, header)\nreader_resp = urllib2.urlopen(reader_req)\nreader_resp_content = reader_resp.read()\n\nprint reader_resp_content\n</code></pre>\n\n<p>Google Reader removed SID auth around June, 2010 (I think), using new Auth from ClientLogin is the new way and it\'s a bit simpler (header is shorter). You will have to add <code>service</code> in data for requesting <code>Auth</code>, I noticed no <code>Auth</code> returned if you don\'t send the <code>service=reader</code>.</p>\n\n<p>You can read more about the change of authentication method in <a href="http://groups.google.com/group/fougrapi/browse_thread/thread/e331f37f7f126c00/" rel="nofollow noreferrer">this thread</a>.</p>\n'}]
['https://Stackoverflow.com/questions/52880', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/383/']