Back to examples

ASP.NET Minimal API Backend

This backend example keeps the PlaceField secret key on the server and exposes a local /api/locations/autocomplete route for your app.

Run Locally

cd examples/aspnet-minimal-api
dotnet run

Open http://localhost:5187/. In Visual Studio, open PlaceField.AspNetMinimalApiExample.sln and click Start Debugging.

Configure The Key

Replace the placeholder in appsettings.json when you want real PlaceField results:

{
  "PlaceField": {
    "SecretKey": "pf_live_xxx",
    "AutocompleteUrl": "https://api.placefield.dev/v1/locations/autocomplete"
  }
}

What The Server Does

This static guide does not call the PlaceField API. Clone the repo and run the server locally to test with your key.

View source on GitHub