Globalping is available as a NuGet package from NuGet and as a PowerShell module from the PowerShell Gallery.
📦 NuGet Package
đź’» PowerShell Module
🛠️ Project Information
👨‍💻 Author & Social
Globalping provides convenient access to the Globalping API from .NET applications and PowerShell. It lets you run network diagnostics such as ping, traceroute, DNS or HTTP checks from hundreds of probes around the world.
The repository contains a cross platform .NET library and a PowerShell module built on top of it. Examples under Globalping.Examples demonstrate advanced usage.
- Make Globalping easy to consume from scripts and applications.
- Offer rich objects for each measurement type while still allowing access to the raw API response.
- Keep dependencies minimal - only the .NET runtime and PowerShell 5.1 or newer are required.
- .NET 8 or newer to build and run the library and example projects.
- PowerShell 5.1 or newer when using the module. PowerShell 7+ is recommended on non‑Windows platforms.
Build the project and import the module:
# After `dotnet build` the module can be loaded
Import-Module ./Module/Globalping.psd1 -ForceRun a simple measurement:
Start-Globalping -Type Ping -Target "example.com" -SimpleLocations "DE" | Format-TableTo use the Locations parameter provide LocationRequest objects. The cmdlet will automatically run one probe for each location when Limit is not specified:
$locations = @(
[Globalping.LocationRequest]@{ Country = "DE"; Limit = 1 },
[Globalping.LocationRequest]@{ Country = "US"; Limit = 1 }
)
Start-Globalping -Type Ping -Target "example.com" -Locations $locations | Format-Table# request three probes from specific countries
$result = Start-Globalping -Type Ping -Target "example.com" -SimpleLocations "DE", "US", "GB"
$result.GetSummaries() | Format-TableUse ISO 3166-1 alpha-2 country codes (e.g. GB for United Kingdom).
To easily access key data from the API response use the GetSummaries() extension method:
$result = Start-Globalping -Type Ping -Target "example.com" -SimpleLocations "DE"
$result.GetSummaries() | Format-TableBy default Start-Globalping will return individual ping timings flattened with
location information. To get the raw API response pass -Raw:
Start-Globalping -Type Ping -Target "example.com" -SimpleLocations "DE" | Format-Table# return the original `MeasurementResponse`
Start-Globalping -Type Ping -Target "example.com" -SimpleLocations "DE" -RawConvert a single result to structured objects:
$mtr = Start-GlobalpingMtr -Target "example.com" -Raw
$hops = $mtr.Results[0].ToMtrHops()
$hops[0] | Format-TableUse -Classic to output the raw ping text similar to the traditional ping command:
Start-Globalping -Type Ping -Target "example.com" -SimpleLocations "DE" -ClassicTo fetch only HTTP headers use Start-GlobalpingHttp with the -HeadersOnly parameter:
Start-GlobalpingHttp -Target "https://example.com" -HeadersOnlyBoth https://example.com and example.com are accepted when running HTTP measurements. The cmdlet automatically extracts the scheme and path.
Request in-progress updates and customize the wait time:
Start-GlobalpingHttp -Target "https://example.com" -Limit 3 -InProgressUpdates -WaitTime 60List currently available probes:
Get-GlobalpingProbe | Format-TableReturn the raw Probes objects:
Get-GlobalpingProbe -Raw | Format-TableThe .NET library exposes the same functionality for applications. A minimal example to run a ping measurement:
using var httpClient = new HttpClient();
var request = new MeasurementRequestBuilder()
.WithType(MeasurementType.Ping)
.WithTarget("example.com")
.AddCountry("DE")
.Build();
var service = new ProbeService(httpClient);
var create = await service.CreateMeasurementAsync(request);
var client = new MeasurementClient(httpClient);
var result = await client.GetMeasurementByIdAsync(create.Id);
foreach (var ping in result!.GetPingTimings())
{
Console.WriteLine($"{ping.City}: {ping.Time} ms");
}More advanced requests can customize locations, limits and measurement options:
var advanced = new MeasurementRequestBuilder()
.WithType(MeasurementType.Http)
.WithTarget("https://example.com/api/data?x=1")
.AddCountry("DE", 2)
.AddCity("Berlin")
.WithLimit(3)
.WithInProgressUpdates()
.WithMeasurementOptions(new HttpOptions
{
Request = new HttpRequestOptions
{
Method = HttpRequestMethod.GET,
Path = "/api/data",
Query = "x=1"
},
Protocol = HttpProtocol.HTTPS,
IpVersion = IpVersion.Six
})
.Build();For HTTP measurements the target may include the scheme (e.g. https://example.com). The library automatically converts it to the correct host, protocol and path.
The API specification is available at api.globalping.io/v1/spec.yaml.
By default both the .NET client and PowerShell module set helpful HTTP headers.
When no User-Agent is specified, Globalping.Net/1.0 is used. If Brotli
compression is available the client sends Accept-Encoding: br, otherwise it
falls back to gzip.
All API clients expose the most recent usage headers via the LastResponseInfo
property. When the service returns values such as X-RateLimit-Limit or
X-Credits-Remaining they will be parsed into this object for easy inspection.
MeasurementClient supports basic caching via ETag. Pass the LastResponseInfo.ETag
value to GetMeasurementByIdAsync or GetMeasurementById. When the API returns
304 Not Modified the previously retrieved measurement data is reused and parsing
is skipped.