PageRankApi is a simple ASP.NET Core 9 web‐API that fetches the Yandex SQI score for any website and maps it to an approximate “PageRank” level (1–10) based on configurable thresholds.
- Features
- Prerequisites
- Getting Started
- Configuration
- Usage
- Swagger / OpenAPI
- Deployment
- Contributing
- License
- Fetches raw SQI from Yandex’s Siteinfo page
- Parses SQI via a pre‐compiled regex
- Maps SQI → PageRank (1–10) using configurable thresholds
- Clean, testable service via DI
- Optional Swagger UI for interactive docs
- .NET 9 SDK (https://dotnet.microsoft.com)
- Visual Studio / Rider / VS Code
- Azure App Service (for production deployment)
- Clone the repo
git clone https://github.com/g4m3r0/PageRankApi.git cd PageRankApi - Configure thresholds (see Configuration)
- Run locally
By default the API listens on
dotnet run
https://localhost:5001.
Threshold mappings live in appsettings.json under PageRankThresholds. Change the SQI cutoffs without code changes:
{
"PageRankThresholds": {
"1": 1,
"2": 10,
"3": 20,
"4": 50,
"5": 100,
"6": 500,
"7": 1000,
"8": 5000,
"9": 8000,
"10":10000
}
}You can also override thresholds via environment variables in Azure.
GET /pagerank/{host}
- host: The target domain (e.g.
example.com).
curl -s https://localhost:5001/pagerank/github.com | jq{
"host": "github.com",
"sqi": 124000,
"pageRank": 10
}- 400 Bad Request
{ "error": "Unable to extract SQI" } - 500 Internal Server Error
Unexpected failures (network, parsing, etc.).
- Interactive UI (Swashbuckle)
https://localhost:5001/swagger - Raw JSON Spec
https://localhost:5001/swagger/v1/swagger.json
If you’re using the built-in .AddOpenApi() only, fetch the spec at:
GET /openapi/v1.json
This repo includes a GitHub Actions workflow (.github/workflows/deploy-to-azure.yml) that:
- Builds & publishes the API
- Deploys to your Azure App Service via your publish profile
Setup:
- Add
AZURE_WEBAPP_NAMEandAZURE_WEBAPP_PUBLISH_PROFILEto your GitHub Secrets. - Push to the
mainbranch.
Watch [Actions → Build and deploy ASP.Net Core app to Azure Web App – pagerankapi] for your deployment status.
- Fork the repo
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes & push (
git push origin feature/your-feature) - Open a Pull Request
Please ensure all new code has unit tests and passes CI (dotnet test).
MIT © 2025 g4m3r0