You must declare the "topSites" permission in your extension's manifest to use this API.
{ "name": "My extension", ... "permissions": [ "topSites", ], ... }
You can find samples of this API in Samples.