INTEGRATIONS / HTTP RECIPE

Vera, meet C# / .NET.

Call Vera from a .NET console application or backend. Use the built-in HTTP and JSON libraries; no Vera SDK is needed.

← All integrations

Your first connection.

  1. 01

    Create a console application with a supported .NET SDK: dotnet new console -n WaggleDemo. The example supports .NET 8 and newer.

  2. 02

    Store VERA_API_KEY in the server environment. Replace WaggleDemo/Program.cs with the C# example below.

  3. 03

    Run dotnet run --project WaggleDemo. In a long-running service, reuse HttpClient or use IHttpClientFactory instead of creating a client for every call.

Tool reference: C# / .NET documentation ↗

Build the request.

Set the environment variables in your terminal for these code examples. In automation tools, enter the URL and credentials in the tool’s own fields.

// .NET 8+ console app; API key is read on the server.
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;

var apiKey = Environment.GetEnvironmentVariable("VERA_API_KEY")
    ?? throw new InvalidOperationException("Set VERA_API_KEY");
using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(45) };
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://vera.waggle.ae/api/vera/v1/scrape");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
request.Content = new StringContent("{\n  \"url\": \"https://example.com\"\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode) throw new HttpRequestException($"Vera HTTP {(int)response.StatusCode}: {body}");
using var result = JsonDocument.Parse(body);
Console.WriteLine(result.RootElement);

This edits a code example. It does not send a request or use credits.

Run a request in your workspace
YOUR PRIVACY

Choose what works for you. You can reopen these settings from the footer at any time.

Essential

Always active

Sign-in, security and preferences you ask us to remember. These keep the service working.

Analytics

Optional Vera visitor reporting counts visits and active browsers; Google Analytics may also measure selected clicks. We don’t send form contents, requested URLs, search queries, passwords, API keys or account emails. Turn it off here at any time.

Advertising

Not in use

No advertising cookies or remarketing tags.

Your choice is stored on this browser for 180 days. Read the cookie policy ↗