Reporting

The Reporting API provides an interface for retrieving all of the SEO metrics about all managed accounts, in one place.

Calling the Reporting API

GET /api/seo_report.(xml|json)

Retrieving your reporting metrics is done by submitting a GET request to our seo_report API controller.

The GET request can optionally specify the following URL parameters:

Parameters:
  • account_id – either a single integer representing the ID of an existing account, or a comma separated list of account IDs
  • start_date – if you wish you filter the results for a specific date range, begin on this date. Date should be in YYYY-MM-DD format
  • end_date – if you wish you filter the results for a specific date range, end on this date. Date should be in YYYY-MM-DD format

Example JSON Response:

<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <accounts type="array">
    <account>
      <5>
        <sites type="array">
          <site>
            <4>
              <download-time type="float">0.35</download-time>
              <pages-indexed-in-google type="integer">8</pages-indexed-in-google>
              <pages-indexed-in-bing type="integer">3</pages-indexed-in-bing>
              <pages-indexed-in-yahoo type="integer">3</pages-indexed-in-yahoo>
              <domain-authority nil="true"></domain-authority>
              <backlink-count type="integer">0</backlink-count>
              <domain-count type="integer">0</domain-count>
              <domain-age type="integer">1234</domain-age>
              <backlinks type="array">
                <backlink>
                  <domain>crushcakes.com</domain>
                  <found-on type="date">2011-06-08</found-on>
                  <link-strength type="integer">5</link-strength>
                  <source-url>http://cupcakestakethecake.blogspot.com/</source-url>
                  <domain-authority type="integer">4</domain-authority>
                  <anchor-text>The best cupcakes ever!</anchor-text>
                </backlink>
              </backlinks>
              <keywords type="array">
                <keyword>
                  <unix type="array">
                    <unix>
                      <locale>en-us</locale>
                      <search-engine>Bing</search-engine>
                      <ranked-at>2010-12-01 08:55:59</ranked-at>
                      <rank type="integer">4</rank>
                    </unix>
                    <unix>
                      <locale>en-us</locale>
                      <search-engine>Yahoo</search-engine>
                      <ranked-at>2010-12-01 08:55:59</ranked-at>
                      <rank nil="true"></rank>
                    </unix>
                    <unix>
                      <locale>en-us</locale>
                      <search-engine>Google</search-engine>
                      <ranked-at>2012-07-12 07:00:00</ranked-at>
                      <rank type="integer">94</rank>
                    </unix>
                  </unix>
                </keyword>
              </keywords>
              <competitors type="array">
                <competitor>
                  <foonarf.com>
                    <backlink-count type="integer">0</backlink-count>
                    <backlinks type="array"/>
                    <domain-count type="integer">0</domain-count>
                    <domain-age type="integer">1589</domain-age>
                    <keywords type="array">
                      <keyword>
                        <unix type="array">
                          <unix>
                            <locale>en-us</locale>
                            <search-engine>Bing</search-engine>
                            <ranked-at>2010-12-01 08:55:59</ranked-at>
                            <rank type="integer">3</rank>
                          </unix>
                          <unix>
                            <locale>en-us</locale>
                            <search-engine>Yahoo</search-engine>
                            <ranked-at>2010-12-01 08:55:59</ranked-at>
                            <rank nil="true"></rank>
                          </unix>
                          <unix>
                            <locale>en-us</locale>
                            <search-engine>Google</search-engine>
                            <ranked-at>2012-07-12 07:00:00</ranked-at>
                            <rank type="integer">4</rank>
                          </unix>
                        </unix>
                      </keyword>
                    </keywords>
                  </foonarf.com>
                </competitor>
              </competitors>
            </4>
          </site>
        </sites>
      </5>
    </account>
  </accounts>
</hash>

Example Ruby Code:

require 'net/http'

Net::HTTP.start('https://api.upcity.com') do |http|
  req = Net::HTTP::Get.new('/api/seo_report.xml?start_date=2012-07-25&end_date=2012-07-26&account_id=1,2,3')
  req.basic_auth 'partner_key', nil
  response = http.request(req)
  print response.body
end
GET /api/accounts/:account_id/reputation_report/detail

Retrieving your reputation details is done by submitting a GET request to our reputation_report API controller.

Example XML Response:

<?xml version="1.0" encoding="UTF-8"?>
<account>
  <id type="integer">1345</id>
  <sites type="array">
    <site>
      <id type="integer">698</id>
      <location>
        <id type="integer">1</id>
        <created-at>2013-04-12T17:34:24Z</created-at>
        <twitter-page nil="true"></twitter-page>
        <facebook-page nil="true"></facebook-page>
        <pages type="array">
          <page>
            <page-url>https://plus.google.com/103710651833296100915</page-url>
            <created-at>2013-04-12T21:25:30Z</created-at>
            <match-confidence type="integer">7</match-confidence>
            <id type="integer">61</id>
            <reviews type="array">
              <review>
                <rating type="integer">5</rating>
                <created-at>2013-04-12T21:25:31Z</created-at>
                <business-name>Law Office of Catherine Brown</business-name>
                <sentiment-score type="integer">0</sentiment-score>
                <url>https://plus.google.com/103710651833296100915/about</url>
                <total type="integer">0</total>
                <page-id type="integer">61</page-id>
                <header>NA</header>
                <id type="integer">17</id>
                <date>2012-04-14</date>
                <detail>out of status to a permanent resident in the United States. I found Catherine by researching immigration lawyers in Internet. I gave her a call and Catherine returned my call personally and I made an appointment to meet with her for a consultation. At our first meeting Catherine thoroughly explained the steps I needed to follow to adjust my status to a permanent resident. During the entire process, Catherine never failed to respond my emails and calls. With her help my case was approved unexpectedly fast, less than 3 months. My husband and I are really happy with her services. I highly recommend Catherine Brown Law Office to anyone needing assistance with immigration matters. During the entire process, I found Catherine professional, extremely knowledgeable and always willing to return a call or email to answer any questions I had. Thank you!</detail>
                <user>A Google User</user>
                <source>google</source>
              </review>
              <review>
                <rating type="integer">5</rating>
                <created-at>2013-04-12T21:25:31Z</created-at>
                <business-name>Law Office of Catherine Brown</business-name>
                <sentiment-score type="integer">0</sentiment-score>
                <url>https://plus.google.com/103710651833296100915/about</url>
                <total type="integer">0</total>
                <page-id type="integer">61</page-id>
                <header>NA</header>
                <id type="integer">16</id>
                <date>2012-04-14</date>
                <detail>Catherine assisted with getting my husband permanent resident status within a very quick turnaround- 3 months. She took the anxiety out of the process by clearly laying out alternative processes and timely communication on next steps and expectations. Catherine is very accessible and responsive. She approaches the situation with professionalism and empathy. We highly recommend Catherine as a immigraton lawyer.</detail>
                <user>A Google User</user>
                <source>google</source>
              </review>
            </reviews>
            <location-id type="integer">1</location-id>
            <last-updated>2013-03-15</last-updated>
            <source>google</source>
          </page>
        </pages>
      </location>
    </site>
  </sites>
</account>

Example Ruby Code:

require 'net/http'

Net::HTTP.start("https://api.upcity.com") do |http|
  req = Net::HTTP::Get.new("/api/accounts/#{account_id}/reputation_report/detail.xml")
  req.basic_auth 'partner_key', nil
  response = http.request(req)
  print response.body
end
GET /api/accounts/:account_id/reputation_report/counts

Retrieving your reputation counts is done by submitting a GET request to our reputation_report API controller.

Example XML Response:

<?xml version="1.0" encoding="UTF-8"?>
<account>
  <id type="integer">1345</id>
  <sites type="array">
    <site>
      <id type="integer">698</id>
      <location>
        <id type="integer">1</id>
        <created-at>2013-04-12T17:34:24Z</created-at>
        <competitors type="array">
          <competitor>
            <id type="integer">8</id>
            <created-at>2013-04-12T21:25:36Z</created-at>
            <pages type="array">
              <page>
                <id type="integer">75</id>
                <page-url>http://www.bing.com/local/details.aspx?lid=YN91x238080163&amp;q=nelson%20honda%20El%20Monte%20CA&amp;qt=yp&amp;tid=9b7d7519a3554a0d860ae146cc00b3ef&amp;FORM=LLSV</page-url>
                <created-at>2013-04-12T21:25:36Z</created-at>
                <review-counts type="array">
                  <review-count>
                    <created-at>2013-04-12T21:25:37Z</created-at>
                    <page-id type="integer">75</page-id>
                    <date>2013-04-12</date>
                    <count type="integer">6</count>
                    <source>citysearch</source>
                    <rating-sum type="integer">30</rating-sum>
                  </review-count>
                </review-counts>
                <match-confidence type="integer">6</match-confidence>
                <last-updated>2013-03-15</last-updated>
                <source>bing</source>
              </page>
            </pages>
          </competitor>
        </competitors>
        <pages type="array">
          <page>
            <id type="integer">61</id>
            <page-url>https://plus.google.com/103710651833296100915</page-url>
            <created-at>2013-04-12T21:25:30Z</created-at>
            <review-counts type="array">
              <review-count>
                <created-at>2013-04-12T21:25:30Z</created-at>
                <page-id type="integer">61</page-id>
                <date>2013-04-12</date>
                <count type="integer">4</count>
                <source>google</source>
                <rating-sum type="integer">20</rating-sum>
              </review-count>
            </review-counts>
            <match-confidence type="integer">7</match-confidence>
            <last-updated>2013-03-15</last-updated>
            <source>google</source>
          </page>
        </pages>
      </location>
    </site>
  </sites>
</account>

Example Ruby Code:

require 'net/http'

Net::HTTP.start("https://api.upcity.com") do |http|
  req = Net::HTTP::Get.new("/api/accounts/#{account_id}/reputation_report/counts.xml")
  req.basic_auth 'partner_key', nil
  response = http.request(req)
  print response.body
end