{"id":28685460,"url":"https://github.com/chilas/algolia-analytics","last_synced_at":"2026-01-18T09:44:29.236Z","repository":{"id":86450862,"uuid":"96240608","full_name":"chilas/algolia-analytics","owner":"chilas","description":"Algolia Analytics Client for .NET","archived":false,"fork":false,"pushed_at":"2017-10-24T11:56:08.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-26T12:54:57.864Z","etag":null,"topics":["algolia","algolia-analytics","api-client","chsarp","dotnet","dotnet-core","dotnet-standard"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chilas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-04T17:30:55.000Z","updated_at":"2017-07-15T21:20:33.000Z","dependencies_parsed_at":"2023-03-07T03:45:40.301Z","dependency_job_id":null,"html_url":"https://github.com/chilas/algolia-analytics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chilas/algolia-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilas%2Falgolia-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilas%2Falgolia-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilas%2Falgolia-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilas%2Falgolia-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chilas","download_url":"https://codeload.github.com/chilas/algolia-analytics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilas%2Falgolia-analytics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algolia","algolia-analytics","api-client","chsarp","dotnet","dotnet-core","dotnet-standard"],"created_at":"2025-06-14T04:00:50.881Z","updated_at":"2026-01-18T09:44:29.210Z","avatar_url":"https://github.com/chilas.png","language":"C#","funding_links":[],"categories":["Community API Clients"],"sub_categories":[],"readme":"# Algolia Analytics Client for .NET\n_built **.NET Standard 1.4**_  \n_PS: Please check the dotnet standard support before use.__\n## Quickstart\nGet popular search for a fixed date period\n```csharp\nconst string apiKey = \"XXXXXXXXXXXXXXXXXXXXXXXXXXX\";\nconst string appId = \"XXXXXXXXX\";\n\n// Create a new client object using the app secrets typically stored away in a safer place than mine :P\nvar analyticsClient = new AnalyticsClient(new AppSecrets()\n{\n    ApplicationId = appId,\n    ApplicationKey = apiKey\n});\n\n// Initialise the new client with the the name of the search index.\nanalyticsClient.InitAnalytics(\"JollofIndex\");\n\n// Specify the filter options for the request\nvar options = new AnalyticsOptions()\n    .StartAt(DateTime.Today.AddDays(-1))\n    .SetCountry(\"NG\")\n    .SetSize(10)\n    .EndAt(DateTime.Now);\n\n// Pass in the options\n// ...and the analytics data you want\nvar popularSearches = await analyticsClient.GetAnalyticsForSearch(options,\n    AnalyticsClient.AnalyticSearchType.Popular);\n```\n\n## Usage  \nThe [Algolia Analytics API Documentation](https://www.algolia.com/doc/rest-api/analytics/) basically provides two kinds of endpoints. One for Searches and another for Rate Limits. So it makes sense to separate these in their individual calling methods as well.   \n\nAnalyticsClient - All new request starts with this. You'd typically have to create a new AnalyticsClient object and pass in your AppSecrets like this `var client = new AnalyticsClient(\u003cAppSecrets\u003e secrets);` You can henceforth use the `client` for all your operations.  \n\nAppSecrets - This has two properties `ApplicationId` and `ApplicationKey` and they are exactly as their name suggests. Please visit your Algolia Dashboard to get both of these.  \n\nAnalyticsOptions - Gives you the ability to set filters for your request. These options were created to match the parameters of the REST API provided by Algolia. Methods include:  \n*  `SetSize(int size)`\n*  `StartAt(DateTime startTime)`\n*  `EndAt(DateTime EndTime)`\n*  `SetTags(IEnumerable\u003cstring\u003e tags)`\n*  `SetCountry(string country)`\n*  `SetRefinements(bool refiments)`  \nSee [Algolia Analytics API Documentation](https://www.algolia.com/doc/rest-api/analytics/) for more information.\n\nInitAnalytics - Used to set the index or indices that would be queried.\n`InitAnalytics(\u003cstring\u003e Index);` or  `InitAnalytics(\u003cIEnumerable\u003cstring\u003e\u003e Indices);`\n\n### Getting Analytics for Search\nAnalyticsSearchType - Specifies what the type of analytics for search should be. These resource endpoints were created to match the different queries of the REST API provided by Algolia.\n*  `AnalyticsSearchType.Popular`\n*  `AnalyticsSearchType.NoResults`\n*  `AnalyticsSearchType.Countries`\n*  `AnalyticsSearchType.Hits`\n*  `AnalyticsSearchType.HitsWithTypo`\n*  `AnalyticsSearchType.TopIps`\n*  `AnalyticsSearchType.Referers`  \nSee [Algolia Analytics API Documentation](https://www.algolia.com/doc/rest-api/analytics/) for more information.\n\nGetAnalyticsForSearch - GetAnalyticsForSearch([\u003cAnalyticsOptions\u003e options], \u003cAnalyticsSearchType\u003e searchType) - Asynchronous method. Takes an optional AnalyticsOptions object and an AnalyticsSearchType enum.\n```csharp\nvar popularSearches = await GetAnalyticsSearch(AnalyticsClient.AnalyticSearchType.Popular);\n/// OR \nvar options = new AnalyticsOptions();\noptions.SetCountry(\"NG\")\n    .SetRefinements(true);\nvar popularSearches = await GetAnalyticsSearch(options, AnalyticsClient.AnalyticSearchType.Popular);\n```\n\n### Getting Analytics for RateLimit\nRateLimitSearchType -  Specifies what the type of analytics for ratelimits should be. These resource endpoints were created to match the different queries of the REST API provided by Algolia.\n*  AnalyticRateLimitType.TopIps`  \nSee [Algolia Analytics API Documentation](https://www.algolia.com/doc/rest-api/analytics/) for more information.\n\nGetAnalyticsForRateLimits - GetAnalyticsForRateLimits([\u003cAnalyticsOptions\u003e options], \u003cAnalyticRateLimitType\u003e rateLimitTypes) - Asynchronous method. Takes an optional AnalyticsOptions object and an AnalyticRateLimitType enum.\n```csharp\nvar rateLimits = await AnalyticRateLimitType(AnalyticsClient.AnalyticSearchType.Popular);\n// OR \nvar options = new AnalyticsOptions();\noptions.SetCountry(\"NG\")\n    .SetRefinements(true);\nvar rateLimits = await AnalyticRateLimitType(options, AnalyticsClient.AnalyticRateLimitType.TopIps);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchilas%2Falgolia-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchilas%2Falgolia-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchilas%2Falgolia-analytics/lists"}