gRPC API
High-Performance gRPC
Binary protocol, HTTP/2 streaming, and strongly-typed contracts. 10x faster than REST for high-throughput batch processing.
10x faster
Bi-di streaming
Type-safe
Services
ValuationService
unaryGetValuation
Get a single valuation by IDunaryCreateValuation
Create a new valuationclient-streamBatchValuate
Stream products for batch valuationserver-streamWatchValuations
Subscribe to valuation updatesProductService
unaryGetProduct
Get product details by SKUserver-streamSearchProducts
Stream matching productsbidirectionalSyncInventory
Bidirectional inventory syncProto Definition
valuation/v1/valuation.proto
syntax = "proto3";
package justkalm.valuation.v1;
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option go_package = "github.com/justkalm/api-go/valuation/v1";
// ValuationService provides luxury goods valuation
service ValuationService {
// Get a single valuation by ID
rpc GetValuation(GetValuationRequest) returns (Valuation);
// Create a new valuation request
rpc CreateValuation(CreateValuationRequest) returns (Valuation);
// Stream products for batch valuation
rpc BatchValuate(stream BatchValuateRequest) returns (BatchValuateResponse);
// Subscribe to real-time valuation updates
rpc WatchValuations(WatchValuationsRequest) returns (stream Valuation);
}
message Valuation {
string id = 1;
string sku = 2;
PriceRange estimated_value = 3;
Confidence confidence = 4;
repeated Factor factors = 5;
google.protobuf.Timestamp created_at = 6;
}
message PriceRange {
int64 min_cents = 1;
int64 max_cents = 2;
string currency = 3;
}
enum Confidence {
CONFIDENCE_UNSPECIFIED = 0;
CONFIDENCE_HIGH = 1;
CONFIDENCE_MEDIUM = 2;
CONFIDENCE_LOW = 3;
}
message Factor {
string name = 1;
double impact = 2;
string description = 3;
}
message GetValuationRequest {
string id = 1;
}
message CreateValuationRequest {
string sku = 1;
string brand = 2;
string category = 3;
Condition condition = 4;
repeated string materials = 5;
}
enum Condition {
CONDITION_UNSPECIFIED = 0;
CONDITION_NEW = 1;
CONDITION_LIKE_NEW = 2;
CONDITION_EXCELLENT = 3;
CONDITION_GOOD = 4;
CONDITION_FAIR = 5;
}Client Examples
Go Client
package main
import (
"context"
"log"
"time"
pb "github.com/justkalm/api-go/valuation/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)
func main() {
// Connect with TLS
creds, err := credentials.NewClientTLSFromFile("ca.pem", "")
if err != nil {
log.Fatalf("failed to load TLS: %v", err)
}
conn, err := grpc.Dial(
"grpc.justkalm.com:443",
grpc.WithTransportCredentials(creds),
grpc.WithPerRPCCredentials(&tokenAuth{token: "YOUR_API_KEY"}),
)
if err != nil {
log.Fatalf("failed to dial: %v", err)
}
defer conn.Close()
client := pb.NewValuationServiceClient(conn)
// Unary call
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
valuation, err := client.GetValuation(ctx, &pb.GetValuationRequest{
Id: "val_abc123",
})
if err != nil {
log.Fatalf("GetValuation failed: %v", err)
}
log.Printf("Valuation: %+v", valuation)
// Server streaming
stream, err := client.WatchValuations(ctx, &pb.WatchValuationsRequest{
OrganizationId: "org_123",
})
if err != nil {
log.Fatalf("WatchValuations failed: %v", err)
}
for {
val, err := stream.Recv()
if err != nil {
break
}
log.Printf("Received: %s = %d-%d %s",
val.Sku,
val.EstimatedValue.MinCents,
val.EstimatedValue.MaxCents,
val.EstimatedValue.Currency,
)
}
}Connection Details
Endpoints
Production
grpc.justkalm.com:443Sandbox
grpc-sandbox.justkalm.com:443Reflection
EnabledAuthentication
MethodPer-RPC credentials
Header
authorizationFormat
Bearer YOUR_API_KEY