PanoramicData.LanSweeper.Api 12.5.13

dotnet add package PanoramicData.LanSweeper.Api --version 12.5.13
                    
NuGet\Install-Package PanoramicData.LanSweeper.Api -Version 12.5.13
                    
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="PanoramicData.LanSweeper.Api" Version="12.5.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PanoramicData.LanSweeper.Api" Version="12.5.13" />
                    
Directory.Packages.props
<PackageReference Include="PanoramicData.LanSweeper.Api" />
                    
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 PanoramicData.LanSweeper.Api --version 12.5.13
                    
#r "nuget: PanoramicData.LanSweeper.Api, 12.5.13"
                    
#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 PanoramicData.LanSweeper.Api@12.5.13
                    
#: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=PanoramicData.LanSweeper.Api&version=12.5.13
                    
Install as a Cake Addin
#tool nuget:?package=PanoramicData.LanSweeper.Api&version=12.5.13
                    
Install as a Cake Tool

LanSweeper.Api

Nuget Codacy Badge License: MIT

A comprehensive .NET library for the LanSweeper Data API (GraphQL), providing easy access to LanSweeper's inventory and asset management data.

Features

  • Full GraphQL Support: Complete access to LanSweeper's GraphQL Data API
  • Type-Safe: Strongly typed C# models for all API responses
  • Modern .NET: Built for .NET 9 with modern C# patterns
  • Authentication: Seamless Personal Access Token (PAT) authentication
  • Error Handling: Comprehensive error handling and custom exceptions
  • Async/Await: Full async support for non-blocking operations
  • Pagination: Built-in support for GraphQL cursor-based pagination
  • Logging: Integrated logging support via Microsoft.Extensions.Logging
  • Modular Design: Organized API structure supporting multiple LanSweeper APIs

Quick Start

Installation

Install the package via NuGet:

dotnet add package LanSweeper.Api

Basic Usage

using LanSweeper.Api;

// Create client with Personal Access Token
var options = new LanSweeperClientOptions
{
    AccessToken = "your-personal-access-token"
};

var client = new LanSweeperClient(options);

// Get authorized sites
var sites = await client.Data.Sites.GetAllAsync();

// Get assets from a site
var assets = await client.Data.Assets.GetBySiteAsync("site-id");

// Execute custom GraphQL query
var result = await client.Data.Reports.ExecuteQueryAsync<CustomModel>("{ your custom query }");

Authentication

LanSweeper.Api uses Personal Access Tokens (PATs) for authentication. To get started:

  1. Log into your LanSweeper portal
  2. Navigate to API Access settings
  3. Generate a Personal Access Token
  4. Use the token in your LanSweeperClientOptions
var options = new LanSweeperClientOptions
{
    AccessToken = "your-personal-access-token",
    GraphQLEndpoint = "https://api.lansweeper.com/api/v2/graphql" // Optional: defaults to this
};

API Structure

The client is organized into logical API groups:

Data API (GraphQL)

Access to LanSweeper's GraphQL Data API for inventory and asset management:

// Sites API
var sites = await client.Data.Sites.GetAllAsync();
var site = await client.Data.Sites.GetByIdAsync("site-id");

// Assets API
var assets = await client.Data.Assets.GetBySiteAsync("site-id");
var asset = await client.Data.Assets.GetByIdAsync("asset-key");

// Users API
var currentUser = await client.Data.Users.GetCurrentAsync();

// Reports API (Custom Queries)
var result = await client.Data.Reports.ExecuteQueryAsync<T>(query, variables);

Available Modules

Data API

  • Sites: Manage and query LanSweeper scanning sites
  • Assets: Access IT inventory and asset data
  • Reports: Execute custom reports and queries
  • Users: User and permissions management

Note: Support for additional LanSweeper APIs (Device Recognition API, Platform API) coming in future releases.

Documentation

Requirements

  • .NET 9.0 or later
  • Valid LanSweeper account with API access
  • Personal Access Token

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Note: This is an unofficial library. LanSweeper is a trademark of Lansweeper NV.

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.

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
12.5.13 104 4/16/2026
12.5.9 314 12/18/2025
12.5.2 165 10/10/2025