MontjoyPlaces 1.0.3

dotnet add package MontjoyPlaces --version 1.0.3
                    
NuGet\Install-Package MontjoyPlaces -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MontjoyPlaces" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MontjoyPlaces" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="MontjoyPlaces" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MontjoyPlaces --version 1.0.3
                    
#r "nuget: MontjoyPlaces, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MontjoyPlaces@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MontjoyPlaces&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=MontjoyPlaces&version=1.0.3
                    
Install as a Cake Tool

MontjoyPlaces C# SDK

Official C# SDK for the Montjoy Places API.

Overview

MontjoyPlaces is a lightweight .NET client for working with the Montjoy Places API. It wraps the HTTP API in a small, async-first SDK and includes models for common request and response payloads.

The SDK currently supports:

  • API key validation with WhoAmIAsync
  • Group management
  • Custom place create, read, update, hide, list, export, import, and delete operations
  • Place override operations
  • US city and ZIP lookup endpoints
  • Category search and lookup endpoints
  • Search across places

Requirements

  • .NET 10.0 SDK or later
  • A Montjoy Places API key

Installation

dotnet add package MontjoyPlaces

Authentication

Create a client with your API key:

using MontjoyPlacesSdk;

using var client = new MontjoyPlaces("your-api-key");

By default, the SDK sends requests to https://api.montjoyplaces.com.

You can also supply:

  • baseUrl to point at a different environment
  • HttpClient if you want to manage connection lifetime yourself
using System.Net.Http;
using MontjoyPlacesSdk;

using var httpClient = new HttpClient();
using var client = new MontjoyPlaces(
    apiKey: "your-api-key",
    baseUrl: "https://api.montjoyplaces.com",
    httpClient: httpClient);

Quick Start

using MontjoyPlacesSdk;

var apiKey = Environment.GetEnvironmentVariable("MONTJOY_PLACES_API_KEY")
    ?? throw new InvalidOperationException("Set MONTJOY_PLACES_API_KEY.");

using var client = new MontjoyPlaces(apiKey);

var whoAmI = await client.WhoAmIAsync();
Console.WriteLine($"tenant={whoAmI.TenantId}, key={whoAmI.KeyName}, readOnly={whoAmI.ReadOnly}");

var groups = await client.ListGroupsAsync(new ListGroupsRequest(Limit: 5));
Console.WriteLine($"group count returned: {groups.Rows.Count}");

var search = await client.SearchPlacesAsync(new SearchPlacesRequest("coffee near Boston MA")
{
    Limit = 3
});

Console.WriteLine($"search results: {search.Count}");
Console.WriteLine(search.Rows);

Common Workflows

Groups

var created = await client.CreateGroupAsync(new GroupCreateRequest("Favorites"));
var updated = await client.UpdateGroupAsync(created.Row.GroupId, new GroupUpdateRequest("Saved Places"));
var listed = await client.ListGroupsAsync(new ListGroupsRequest(Limit: 10));
await client.DeleteGroupAsync(created.Row.GroupId);

Custom Places

var place = await client.CreateCustomPlaceAsync(new CustomPlaceCreateRequest(
    Name: "Coffee Stop",
    Latitude: 42.3601,
    Longitude: -71.0589)
{
    Address = "1 Beacon St",
    Locality = "Boston",
    Region = "MA",
    Postcode = "02108",
    Country = "US",
    Website = "https://example.com",
    Tags = new[] { "coffee", "favorite" },
    Meta = new Dictionary<string, object?> { ["source"] = "README" }
});

var fetched = await client.GetCustomPlaceAsync(place.Row.CustomPlaceId);

var updated = await client.UpdateCustomPlaceAsync(place.Row.CustomPlaceId, new CustomPlaceUpdateRequest
{
    Name = "Coffee Stop Updated",
    Website = "https://example.com/updated"
});

await client.HideCustomPlaceAsync(place.Row.CustomPlaceId, new CustomPlaceHideRequest(true));
await client.HideCustomPlaceAsync(place.Row.CustomPlaceId, new CustomPlaceHideRequest(false));
await client.DeleteCustomPlaceAsync(place.Row.CustomPlaceId);

Custom Place Export and Import

var exported = await client.ExportCustomPlacesAsync(new ExportCustomPlacesRequest
{
    GroupId = "group_123",
    IncludeHidden = true
});

var imported = await client.ImportCustomPlacesAsync(new CustomPlacesImportRequest
{
    Mode = "upsert",
    Rows = exported.Rows.Select(row => new CustomPlaceImportRow(row.Name, row.Latitude, row.Longitude)
    {
        CustomPlaceIdSnakeCase = row.CustomPlaceId,
        GroupIdSnakeCase = row.GroupId
    }).ToList()
});
var response = await client.SearchPlacesAsync(new SearchPlacesRequest("pizza")
{
    Lat = 42.3601,
    Lon = -71.0589,
    RadiusMeters = 2000,
    Limit = 10
});

Console.WriteLine(response.Rows);

Lookup Endpoints

var nearestCities = await client.LookupNearestUsCitiesAsync(new NearestUsCitiesRequest(42.3601, -71.0589)
{
    Limit = 5
});

var citySearch = await client.SearchUsCitiesAsync(new SearchUsCitiesRequest("Boston")
{
    State = "MA",
    Limit = 10
});

var zipLookup = await client.LookupUsZipcodeAsync("02108");

var categories = await client.SearchCategoriesAsync(new SearchCategoriesRequest
{
    Query = "coffee",
    Limit = 10
});

Error Handling

API failures throw MontjoyPlacesException.

try
{
    var whoAmI = await client.WhoAmIAsync();
}
catch (MontjoyPlacesException ex)
{
    Console.WriteLine($"Status: {(int)ex.StatusCode}");
    Console.WriteLine(ex.Message);
    Console.WriteLine(ex.ResponseBody);
}

Notes

  • All SDK methods are asynchronous and support CancellationToken.
  • Request and response payloads use System.Text.Json.
  • If you pass your own HttpClient, the SDK will not dispose it.
  • SearchResponse.Rows is returned as JsonElement to preserve the raw search payload.

Samples

Sample programs are included in samples/:

  • BasicSample.cs shows authentication, group listing, and search
  • IntegrationSample.cs exercises create, update, hide, list, export, import, and cleanup flows for groups and custom places

Run a sample with an API key set in the environment:

MONTJOY_PLACES_API_KEY=your-api-key dotnet run --project samples/MontjoyPlaces.Sample.csproj

Package Metadata

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 106 5/3/2026
1.0.2 107 3/31/2026
1.0.1 111 3/14/2026
1.0.0 106 3/14/2026