SDK · Go

PropRaven Go SDK

Typed Go client for the PropRaven API. Generated from OpenAPI 3.1 via Stainless — same source of truth as the Python and TypeScript SDKs. Go 1.22+.

Install

go get github.com/jdw2111/propraven-go@latest

Go 1.22 or newer. Pulls in github.com/tidwall/gjson and sjson for JSON path handling.

Quickstart

package main

import (
    "context"
    "fmt"
    "log"
    "os"

    "github.com/jdw2111/propraven-go"
    "github.com/jdw2111/propraven-go/option"
)

func main() {
    client := propraven.NewClient(
        option.WithAPIKey(os.Getenv("PROPRAVEN_API_KEY")),
    )

    ctx := context.Background()

    parcel, err := client.V1.Parcels.Get(ctx, "06037:1234-567-890")
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("%+v\n", parcel.ParcelID)
}

PROPRAVEN_API_KEY and PROPRAVEN_BASE_URL are read from the environment automatically by NewClient.

API surface

Everything sits under client.V1.* to mirror the REST paths:

  • client.V1.Parcels · Get / GetOwner / GetPermits / GetDeeds
  • client.V1.Search.Parcels · geo + filter search
  • client.V1.Owners · Get / GetPortfolio
  • client.V1.Deals · Absentee / Flips
  • client.V1.Market · GetCounty
  • client.V1.Webhooks · NewEndpoint / ListEndpoints / DisableEndpoint / GetDeliveries
  • client.V1.Account.Usage · usage + quota
  • client.V1.GetCoverage · state/county data coverage

Full reference on pkg.go.dev.

Webhook verification

propraven.VerifyWebhook performs constant-time HMAC-SHA256 verification with a 5-minute replay window. Same contract as the Python and TypeScript verifiers.

func webhookHandler(w http.ResponseWriter, r *http.Request) {
    body, _ := io.ReadAll(r.Body)
    sig := r.Header.Get("X-PropRaven-Signature")

    if err := propraven.VerifyWebhook(sig, body, os.Getenv("PROPRAVEN_WEBHOOK_SECRET")); err != nil {
        http.Error(w, "invalid signature", http.StatusUnauthorized)
        return
    }
    // Decode and process the event…
    w.WriteHeader(http.StatusOK)
}

Error handling

parcel, err := client.V1.Parcels.Get(ctx, "missing")
if err != nil {
    var pe *propraven.Error
    if errors.As(err, &pe) {
        log.Printf("status=%d request_id=%s", pe.StatusCode, pe.Header.Get("X-Request-Id"))
    }
}

The client retries 429s and idempotent 5xx by default. Disable with option.WithMaxRetries(0).

Options

client := propraven.NewClient(
    option.WithAPIKey(os.Getenv("PROPRAVEN_API_KEY")),
    option.WithBaseURL("https://api.propraven.com"),
    option.WithMaxRetries(3),
    option.WithRequestTimeout(60 * time.Second),
    option.WithHeader("X-Trace-Id", "..."),
)