DEV Community

Cover image for Bing Webmaster API Returns Empty Lists While the Dashboard Shows Data
Nesim Razon
Nesim Razon

Posted on Originally published at nesimapps.com

Bing Webmaster API Returns Empty Lists While the Dashboard Shows Data

A few weeks after launching a site, the Bing Webmaster Tools dashboard showed search keywords, pages and backlinks, but the API returned empty lists for the same things. Only part of the API had data. If your own dashboard built on that API looks empty, this is what I found, which calls worked and how I filled the gap honestly.

The mismatch

In the Bing dashboard the Search Performance page listed six keywords, three pages and a country and device split. The Backlinks page showed two referring domains and twenty referring pages. My report, which calls the API, showed a handful of totals and a chart and nothing else, and I suspected my own code.

I tested each call by hand

I called the API methods one at a time. The daily traffic call returned two days of clicks and impressions. The crawl statistics call returned crawled pages, indexed pages and inbound link counts. The feeds call returned my sitemap and how many URLs Bing had read from it. The submission quota call returned the daily and monthly limits.

The calls for queries, pages, query by page, link counts, links for a URL and keyword statistics all returned empty lists with a normal success status. There was no error to catch. The data simply was not exposed through the API yet, even though the dashboard had it.

A useful by-product

The feeds call showed Bing had read 328 URLs from my sitemap while the file had 381. That told me the sitemap was outdated on their side, and resubmitting it in the dashboard fixed it. Small details like this are easy to miss if you only watch totals.

How I handled the gap

I did not want an empty tab, and I did not want to invent numbers. I read the dashboard tables once through the browser, saved them in a small file with the date and the date range, and made the report use that file whenever the API lists are empty. The report prints a clear note that these lists come from the dashboard on a given date, and it switches to the API automatically once the API returns data.

Lessons

  • An empty list with a success status is not proof there is no data. Compare with the dashboard before you blame your code.
  • Test every API method separately, and keep the raw responses of the first run.
  • Label the source and the date of every number you copy from a dashboard.
  • Use the extra calls: sitemap read counts and crawl stats found a real problem.
  • Re-check in a week or two, because new sites fill in slowly.

FAQ

Why does the Bing API return empty lists for queries and pages?

On a new site the detail data may not be exposed through the API yet, even when the dashboard already shows it. The calls succeed but return no rows.

Which Bing API calls worked on a new site?

The daily traffic totals, crawl statistics, sitemap feed status and the URL submission quota.

Is it a bug in my code?

Test each call by hand first. If the raw response is an empty list with a success status, the data is not coming from the API.

How can I show the data in the meantime?

Copy the dashboard tables to a dated file and label them clearly, then switch back to the API when it returns rows.

Top comments (0)