{"action":"created","issue":{"url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2810","labels_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2810/labels{/name}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2810/comments","events_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2810/events","html_url":"https://github.com/NuGet/NuGetGallery/issues/2810","id":122153607,"number":2810,"title":"Is there an API into the NuGet.org datawarehouse?","user":{"login":"yishaigalatzer","id":1238711,"avatar_url":"https://avatars.githubusercontent.com/u/1238711?v=3","gravatar_id":"","url":"https://api.github.com/users/yishaigalatzer","html_url":"https://github.com/yishaigalatzer","followers_url":"https://api.github.com/users/yishaigalatzer/followers","following_url":"https://api.github.com/users/yishaigalatzer/following{/other_user}","gists_url":"https://api.github.com/users/yishaigalatzer/gists{/gist_id}","starred_url":"https://api.github.com/users/yishaigalatzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yishaigalatzer/subscriptions","organizations_url":"https://api.github.com/users/yishaigalatzer/orgs","repos_url":"https://api.github.com/users/yishaigalatzer/repos","events_url":"https://api.github.com/users/yishaigalatzer/events{/privacy}","received_events_url":"https://api.github.com/users/yishaigalatzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-14T23:10:38Z","updated_at":"2015-12-15T07:34:05Z","closed_at":null,"body":"From @dkackman\r\n\r\nI am trying to get at the data from the NuGet gallery that would show package usage statistics. (Downloads over time, NuGet action per download etc.)\r\n\r\nThere is the NuGet data warehouse project but I do not see any API to access the nugget.org instance, so I'm assuming that it is purely to drive what is shown on the gallery website.\r\n\r\nIs there an API other than https://api-v3search-0.nuget.org/query or the older https://nuget.org/api/v2 OData feed that can be used to get at NuGet.org package stats?"},"comment":{"url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/comments/164673241","html_url":"https://github.com/NuGet/NuGetGallery/issues/2810#issuecomment-164673241","issue_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2810","id":164673241,"user":{"login":"maartenba","id":485230,"avatar_url":"https://avatars.githubusercontent.com/u/485230?v=3","gravatar_id":"","url":"https://api.github.com/users/maartenba","html_url":"https://github.com/maartenba","followers_url":"https://api.github.com/users/maartenba/followers","following_url":"https://api.github.com/users/maartenba/following{/other_user}","gists_url":"https://api.github.com/users/maartenba/gists{/gist_id}","starred_url":"https://api.github.com/users/maartenba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maartenba/subscriptions","organizations_url":"https://api.github.com/users/maartenba/orgs","repos_url":"https://api.github.com/users/maartenba/repos","events_url":"https://api.github.com/users/maartenba/events{/privacy}","received_events_url":"https://api.github.com/users/maartenba/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T07:34:04Z","updated_at":"2015-12-15T07:34:04Z","body":"@daveaglick You can use the catalog for this type of traversal. It is an append-log tree structure which has one blob page per “Add package” or “Edit Package” action that happens in the Gallery. All metadata of the package can be accessed from here. We use this catalog ourselves to populate the search index and so on. \r\n\r\nThe root level index page of the catalog can be seen @ http://api.nuget.org/v3/catalog0/index.json. This has links to the individual pages (the second level nodes in the tree). The pages in turn will have links to the individual Package blobs (the leaf nodes the tree). Each leaf node will indicate a specific version of a package. \r\n\r\nTo traverse through the catalog, you read the index and go to the individual pages from there and then follow the link to individual packages. Each “Page” (second level) and “Package” (leaf level) has a time stamp to indicate when it was created. If you are doing continuous replication, you can maintain a time stamp marker on your end (something like “LastRead”). Whenever you replication job starts, it will get the “LastRead” marker and go to the “Pages” created after the “LastRead” time stamp and go to the individual Packages.  \r\n\r\nSample code you say? You can clone the repo @ https://github.com/NuGet/NuGet.Services.Metadata. The https://github.com/NuGet/NuGet.Services.Metadata/blob/master/src/Ng/Catalog2Registration.cs is an example of a “CatalogReader” which reads from the catalog and creates registration blobs. It maintains a LastReader marker which is stored in “Curson.json”. On similar lines https://github.com/NuGet/NuGet.Services.Metadata/blob/master/src/Ng/Catalog2Lucene.cs is another “CatalogReader” which continuously reads from catalog and updates our search index.\r\n\r\n@dkackman Regarding statistics, we currently have no public API for this. We will discuss this internally and see what we can do here."}}