In [10]:
from apiclient.http import BatchHttpRequest
from apiclient.discovery import build
import json
import pprint
import pandas
from psinsights import Service

In [12]:
# Use your Google API key
service = Service('AIzaSyA3FfXgcx1LF5wLNUjVrFB9ioJ8cQrRgkM')
analysis = service.analyze('https://www.gov.uk/marriage-allowance')
print analysis.title


Apply for Marriage Allowance - GOV.UK

In [13]:
print analysis.score


85

In [19]:
stats = analysis.statistics
print stats.total_request_bytes


3873

In [14]:
for rule in analysis.results.rules.itervalues():
     if rule.impact != 0.0:
         print rule.localized_name, rule.impact


Eliminate render-blocking JavaScript and CSS in above-the-fold content 14.0
Leverage browser caching 0.494047619048
Optimize images 0.1458
Minify JavaScript 0.5092

In [8]:
# uses http://stackoverflow.com/questions/30519842/how-to-use-pagespeed-insights-api-with-google-api-python-client
URL_LIST = ['https://www.gov.uk/marriage-allowance']
api_key = 'AIzaSyA3FfXgcx1LF5wLNUjVrFB9ioJ8cQrRgkM'

def handle_metrics_results(request_id, response, exception):
        if exception is not None:
            # What say you?
            print 'That didn\'t work ' + str(exception)
        else:
            # print result
            print str(response)

# use the build() function to create a service object. It takes an API name and API version as arguments
insights_service = build('pagespeedonline', 'v2', developerKey=api_key)

# allows your application to put several API calls into a single HTTP request
insights_request_batch = BatchHttpRequest(callback=handle_metrics_results)

# the loop
for one_url in URL_LIST:
    insights_request_batch.add(
        # Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other info
        insights_service.pagespeedapi().runpagespeed(url=one_url)) 

# Creating a request does not actually call the API. To execute the request and get a response, call the execute() function
response = insights_request_batch.execute()


{u'kind': u'pagespeedonline#result', u'formattedResults': {u'locale': u'en_US', u'ruleResults': {u'MinifyHTML': {u'localizedRuleName': u'Minify HTML', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/MinifyResources', u'key': u'LINK'}], u'format': u'Your HTML is minified. Learn more about {{BEGIN_LINK}}minifying HTML{{END_LINK}}.'}}, u'MinimizeRenderBlockingResources': {u'localizedRuleName': u'Eliminate render-blocking JavaScript and CSS in above-the-fold content', u'urlBlocks': [{u'header': {u'format': u'None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML.'}}, {u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/BlockingJS', u'key': u'LINK'}], u'format': u'{{BEGIN_LINK}}Remove render-blocking JavaScript{{END_LINK}}:'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/govuk-template-c4f303154d2a238bdda4d5cf1ebd8d4487822e4cbc3e4c83e743da869443ce72.js', u'key': u'URL'}], u'format': u'{{URL}}'}}]}, {u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery', u'key': u'LINK'}], u'format': u'{{BEGIN_LINK}}Optimize CSS Delivery{{END_LINK}} of the following:'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/govuk-template-b5d680ad6607cf5441a22a3a533e92b40b15b8f6b9708dbdfc5fc6da71949113.css', u'key': u'URL'}], u'format': u'{{URL}}'}}, {u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/fonts-5ff8c53913434afd0072a480d7cfca67cace4c8d03f6ef96b78a4455728ce745.css', u'key': u'URL'}], u'format': u'{{URL}}'}}, {u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/static-38550062a261ade58f78af85618c631f607f0c4eca6302d6e15f97104734a049.css', u'key': u'URL'}], u'format': u'{{URL}}'}}, {u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/frontend/application-9d7dc93390d78af2c6e8db26e22647164bc84835589c45f9c7fb6dfd1b520638.css', u'key': u'URL'}], u'format': u'{{URL}}'}}]}], u'groups': [u'SPEED'], u'ruleImpact': 14.0, u'summary': {u'args': [{u'type': u'INT_LITERAL', u'value': u'1', u'key': u'NUM_SCRIPTS'}, {u'type': u'INT_LITERAL', u'value': u'4', u'key': u'NUM_CSS'}], u'format': u'Your page has {{NUM_SCRIPTS}} blocking script resources and {{NUM_CSS}} blocking CSS resources. This causes a delay in rendering your page.'}}, u'EnableGzipCompression': {u'localizedRuleName': u'Enable compression', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/EnableCompression', u'key': u'LINK'}], u'format': u'You have compression enabled. Learn more about {{BEGIN_LINK}}enabling compression{{END_LINK}}.'}}, u'MainResourceServerResponseTime': {u'localizedRuleName': u'Reduce server response time', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/Server', u'key': u'LINK'}], u'format': u'Your server responded quickly. Learn more about {{BEGIN_LINK}}server response time optimization{{END_LINK}}.'}}, u'MinifyCss': {u'localizedRuleName': u'Minify CSS', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/MinifyResources', u'key': u'LINK'}], u'format': u'Your CSS is minified. Learn more about {{BEGIN_LINK}}minifying CSS{{END_LINK}}.'}}, u'LeverageBrowserCaching': {u'localizedRuleName': u'Leverage browser caching', u'urlBlocks': [{u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/LeverageBrowserCaching', u'key': u'LINK'}], u'format': u'{{BEGIN_LINK}}Leverage browser caching{{END_LINK}} for the following cacheable resources:'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://www.google-analytics.com/analytics.js', u'key': u'URL'}, {u'type': u'DURATION', u'value': u'2 hours', u'key': u'LIFETIME'}], u'format': u'{{URL}} ({{LIFETIME}})'}}]}], u'groups': [u'SPEED'], u'ruleImpact': 0.49404761904761907, u'summary': {u'format': u'Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.'}}, u'AvoidLandingPageRedirects': {u'localizedRuleName': u'Avoid landing page redirects', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/AvoidRedirects', u'key': u'LINK'}], u'format': u'Your page has no redirects. Learn more about {{BEGIN_LINK}}avoiding landing page redirects{{END_LINK}}.'}}, u'OptimizeImages': {u'localizedRuleName': u'Optimize images', u'urlBlocks': [{u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/OptimizeImages', u'key': u'LINK'}, {u'type': u'BYTES', u'value': u'999B', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'88%', u'key': u'PERCENTAGE'}], u'format': u'{{BEGIN_LINK}}Optimize the following images{{END_LINK}} to reduce their size by {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/bullet-disc-5px-e3393763a04698f106321c52befae8f12a9667828004c9f18850aab735a7a577.gif', u'key': u'URL'}, {u'type': u'BYTES', u'value': u'999B', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'88%', u'key': u'PERCENTAGE'}], u'format': u'Losslessly compressing {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).'}}]}], u'groups': [u'SPEED'], u'ruleImpact': 0.14579999999999999, u'summary': {u'format': u'Properly formatting and compressing images can save many bytes of data.'}}, u'PrioritizeVisibleContent': {u'localizedRuleName': u'Prioritize visible content', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/PrioritizeVisibleContent', u'key': u'LINK'}], u'format': u'You have the above-the-fold content properly prioritized. Learn more about {{BEGIN_LINK}}prioritizing visible content{{END_LINK}}.'}}, u'MinifyJavaScript': {u'localizedRuleName': u'Minify JavaScript', u'urlBlocks': [{u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/MinifyResources', u'key': u'LINK'}, {u'type': u'BYTES', u'value': u'4.7KiB', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'12%', u'key': u'PERCENTAGE'}], u'format': u'{{BEGIN_LINK}}Minify JavaScript{{END_LINK}} for the following resources to reduce their size by {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/frontend/frontend-10f4f61a27c820ff4b83b9a886caa1ee9ba490f267c271c8cfc6ddab7bcdbb15.js', u'key': u'URL'}, {u'type': u'BYTES', u'value': u'3.2KiB', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'32%', u'key': u'PERCENTAGE'}], u'format': u'Minifying {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction) after compression.'}}, {u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/application-85cc0b40057cba8b8797a31cc96ac0ea780681955107a5e60edaa80d0ac5e327.js', u'key': u'URL'}, {u'type': u'BYTES', u'value': u'1.5KiB', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'5%', u'key': u'PERCENTAGE'}], u'format': u'Minifying {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction) after compression.'}}]}], u'groups': [u'SPEED'], u'ruleImpact': 0.5092000000000001, u'summary': {u'format': u'Compacting JavaScript code can save many bytes of data and speed up downloading, parsing, and execution time.'}}}}, u'title': u'Apply for Marriage Allowance - GOV.UK', u'ruleGroups': {u'SPEED': {u'score': 85}}, u'version': {u'major': 1, u'minor': 15}, u'responseCode': 200, u'pageStats': {u'otherResponseBytes': u'893', u'totalRequestBytes': u'3874', u'numberCssResources': 6, u'javascriptResponseBytes': u'283062', u'cssResponseBytes': u'498485', u'imageResponseBytes': u'15821', u'numberResources': 24, u'numberHosts': 4, u'numberStaticResources': 20, u'htmlResponseBytes': u'17982', u'numberJsResources': 5}, u'id': u'https://www.gov.uk/marriage-allowance'}

In [41]:
jsonFile = "{u'kind': u'pagespeedonline#result', u'formattedResults': {u'locale': u'en_US', u'ruleResults': {u'MinifyHTML': {u'localizedRuleName': u'Minify HTML', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/MinifyResources', u'key': u'LINK'}], u'format': u'Your HTML is minified. Learn more about {{BEGIN_LINK}}minifying HTML{{END_LINK}}.'}}, u'MinimizeRenderBlockingResources': {u'localizedRuleName': u'Eliminate render-blocking JavaScript and CSS in above-the-fold content', u'urlBlocks': [{u'header': {u'format': u'None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML.'}}, {u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/BlockingJS', u'key': u'LINK'}], u'format': u'{{BEGIN_LINK}}Remove render-blocking JavaScript{{END_LINK}}:'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/govuk-template-c4f303154d2a238bdda4d5cf1ebd8d4487822e4cbc3e4c83e743da869443ce72.js', u'key': u'URL'}], u'format': u'{{URL}}'}}]}, {u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery', u'key': u'LINK'}], u'format': u'{{BEGIN_LINK}}Optimize CSS Delivery{{END_LINK}} of the following:'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/govuk-template-b5d680ad6607cf5441a22a3a533e92b40b15b8f6b9708dbdfc5fc6da71949113.css', u'key': u'URL'}], u'format': u'{{URL}}'}}, {u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/fonts-5ff8c53913434afd0072a480d7cfca67cace4c8d03f6ef96b78a4455728ce745.css', u'key': u'URL'}], u'format': u'{{URL}}'}}, {u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/static-38550062a261ade58f78af85618c631f607f0c4eca6302d6e15f97104734a049.css', u'key': u'URL'}], u'format': u'{{URL}}'}}, {u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/frontend/application-9d7dc93390d78af2c6e8db26e22647164bc84835589c45f9c7fb6dfd1b520638.css', u'key': u'URL'}], u'format': u'{{URL}}'}}]}], u'groups': [u'SPEED'], u'ruleImpact': 14.0, u'summary': {u'args': [{u'type': u'INT_LITERAL', u'value': u'1', u'key': u'NUM_SCRIPTS'}, {u'type': u'INT_LITERAL', u'value': u'4', u'key': u'NUM_CSS'}], u'format': u'Your page has {{NUM_SCRIPTS}} blocking script resources and {{NUM_CSS}} blocking CSS resources. This causes a delay in rendering your page.'}}, u'EnableGzipCompression': {u'localizedRuleName': u'Enable compression', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/EnableCompression', u'key': u'LINK'}], u'format': u'You have compression enabled. Learn more about {{BEGIN_LINK}}enabling compression{{END_LINK}}.'}}, u'MainResourceServerResponseTime': {u'localizedRuleName': u'Reduce server response time', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/Server', u'key': u'LINK'}], u'format': u'Your server responded quickly. Learn more about {{BEGIN_LINK}}server response time optimization{{END_LINK}}.'}}, u'MinifyCss': {u'localizedRuleName': u'Minify CSS', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/MinifyResources', u'key': u'LINK'}], u'format': u'Your CSS is minified. Learn more about {{BEGIN_LINK}}minifying CSS{{END_LINK}}.'}}, u'LeverageBrowserCaching': {u'localizedRuleName': u'Leverage browser caching', u'urlBlocks': [{u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/LeverageBrowserCaching', u'key': u'LINK'}], u'format': u'{{BEGIN_LINK}}Leverage browser caching{{END_LINK}} for the following cacheable resources:'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://www.google-analytics.com/analytics.js', u'key': u'URL'}, {u'type': u'DURATION', u'value': u'2 hours', u'key': u'LIFETIME'}], u'format': u'{{URL}} ({{LIFETIME}})'}}]}], u'groups': [u'SPEED'], u'ruleImpact': 0.49404761904761907, u'summary': {u'format': u'Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.'}}, u'AvoidLandingPageRedirects': {u'localizedRuleName': u'Avoid landing page redirects', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/AvoidRedirects', u'key': u'LINK'}], u'format': u'Your page has no redirects. Learn more about {{BEGIN_LINK}}avoiding landing page redirects{{END_LINK}}.'}}, u'OptimizeImages': {u'localizedRuleName': u'Optimize images', u'urlBlocks': [{u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/OptimizeImages', u'key': u'LINK'}, {u'type': u'BYTES', u'value': u'999B', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'88%', u'key': u'PERCENTAGE'}], u'format': u'{{BEGIN_LINK}}Optimize the following images{{END_LINK}} to reduce their size by {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/bullet-disc-5px-e3393763a04698f106321c52befae8f12a9667828004c9f18850aab735a7a577.gif', u'key': u'URL'}, {u'type': u'BYTES', u'value': u'999B', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'88%', u'key': u'PERCENTAGE'}], u'format': u'Losslessly compressing {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).'}}]}], u'groups': [u'SPEED'], u'ruleImpact': 0.14579999999999999, u'summary': {u'format': u'Properly formatting and compressing images can save many bytes of data.'}}, u'PrioritizeVisibleContent': {u'localizedRuleName': u'Prioritize visible content', u'groups': [u'SPEED'], u'ruleImpact': 0.0, u'summary': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/PrioritizeVisibleContent', u'key': u'LINK'}], u'format': u'You have the above-the-fold content properly prioritized. Learn more about {{BEGIN_LINK}}prioritizing visible content{{END_LINK}}.'}}, u'MinifyJavaScript': {u'localizedRuleName': u'Minify JavaScript', u'urlBlocks': [{u'header': {u'args': [{u'type': u'HYPERLINK', u'value': u'https://developers.google.com/speed/docs/insights/MinifyResources', u'key': u'LINK'}, {u'type': u'BYTES', u'value': u'4.7KiB', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'12%', u'key': u'PERCENTAGE'}], u'format': u'{{BEGIN_LINK}}Minify JavaScript{{END_LINK}} for the following resources to reduce their size by {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).'}, u'urls': [{u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/frontend/frontend-10f4f61a27c820ff4b83b9a886caa1ee9ba490f267c271c8cfc6ddab7bcdbb15.js', u'key': u'URL'}, {u'type': u'BYTES', u'value': u'3.2KiB', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'32%', u'key': u'PERCENTAGE'}], u'format': u'Minifying {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction) after compression.'}}, {u'result': {u'args': [{u'type': u'URL', u'value': u'https://assets.digital.cabinet-office.gov.uk/static/application-85cc0b40057cba8b8797a31cc96ac0ea780681955107a5e60edaa80d0ac5e327.js', u'key': u'URL'}, {u'type': u'BYTES', u'value': u'1.5KiB', u'key': u'SIZE_IN_BYTES'}, {u'type': u'PERCENTAGE', u'value': u'5%', u'key': u'PERCENTAGE'}], u'format': u'Minifying {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction) after compression.'}}]}], u'groups': [u'SPEED'], u'ruleImpact': 0.5092000000000001, u'summary': {u'format': u'Compacting JavaScript code can save many bytes of data and speed up downloading, parsing, and execution time.'}}}}, u'title': u'Apply for Marriage Allowance - GOV.UK', u'ruleGroups': {u'SPEED': {u'score': 85}}, u'version': {u'major': 1, u'minor': 15}, u'responseCode': 200, u'pageStats': {u'otherResponseBytes': u'889', u'totalRequestBytes': u'3869', u'numberCssResources': 6, u'javascriptResponseBytes': u'283061', u'cssResponseBytes': u'498484', u'imageResponseBytes': u'15815', u'numberResources': 24, u'numberHosts': 4, u'numberStaticResources': 20, u'htmlResponseBytes': u'17981', u'numberJsResources': 5}, u'id': u'https://www.gov.uk/marriage-allowance'}"

In [43]:
# j = json.dumps(jsonFile)
parsed_json = json.loads(jsonFile)


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-43-fc51219fab42> in <module>()
      1 # j = json.dumps(jsonFile)
----> 2 parsed_json = json.loads(jsonFile)

/Applications/anaconda/lib/python2.7/json/__init__.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    336             parse_int is None and parse_float is None and
    337             parse_constant is None and object_pairs_hook is None and not kw):
--> 338         return _default_decoder.decode(s)
    339     if cls is None:
    340         cls = JSONDecoder

/Applications/anaconda/lib/python2.7/json/decoder.pyc in decode(self, s, _w)
    364 
    365         """
--> 366         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    367         end = _w(s, end).end()
    368         if end != len(s):

/Applications/anaconda/lib/python2.7/json/decoder.pyc in raw_decode(self, s, idx)
    380         """
    381         try:
--> 382             obj, end = self.scan_once(s, idx)
    383         except StopIteration:
    384             raise ValueError("No JSON object could be decoded")

ValueError: Expecting property name: line 1 column 2 (char 1)

In [ ]: