Fingerprint is a device intelligence platform offering industry-leading accuracy.
🚧 Deprecation Notice > > This version of Server API is marked as deprecated starting on Jan 7th 2026 and will be fully defunct on Jan 7th 2027 according to our API Deprecation Policy. If you still use this version, please follow our migration guide to migrate from this deprecated version to the new one. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
This Go package is automatically generated by the Swagger Codegen project:
- API version: 3
- Package version: 7.10.0
- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen
Go Lang 1.21 or higher
We keep the Go support policy and support the last two major versions of Go.
- Get the package from GitHub:
go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk- Import and use the library:
package main
import (
"context"
"fmt"
"github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk"
"log"
)
func main() {
cfg := sdk.NewConfiguration()
client := sdk.NewAPIClient(cfg)
// You can also use sdk.RegionUS or sdk.RegionAsia. Default one is sdk.RegionUS
//cfg.ChangeRegion(sdk.RegionEU)
// Configure authorization, in our case with API Key
auth := context.WithValue(context.Background(), sdk.ContextAPIKey, sdk.APIKey{
Key: "SECRET_API_KEY",
})
// Usually this data will come from your frontend app
visitorId := "<VISITOR_ID>"
requestId := "<REQUEST_ID>"
opts := sdk.FingerprintApiGetVisitsOpts{
// Get visits for this requestId
RequestId: requestId,
}
// Get visits for given visitorId and requestId
visits, httpRes, err := client.FingerprintApi.GetVisits(auth, visitorId, &opts)
fmt.Printf("%+v\n", httpRes)
if err != nil {
var tooManyRequestsError *sdk.TooManyRequestsError
// Handle potential TooManyRequestsError
if errors.As(err, &tooManyRequestsError) {
log.Fatalf("Too many requests, retry after %d seconds", tooManyRequestsError.RetryAfter())
} else {
// You can also use err.Model() and err.Body() to get more details about the error
log.Printf("Error %s: %v", err.Code(), err)
log.Fatal(err)
}
}
fmt.Printf("Got response with visitorId: %s", visits.VisitorId)
// Get event by given requestId
event, httpRes, err := client.FingerprintApi.GetEvent(auth, requestId)
if err != nil {
// You can also use err.Model() and err.Body() to get more details about the error
log.Printf("Error %s: %v", err.Code(), err)
log.Fatal(err)
}
// Access identification details
if event.Products.Identification != nil {
fmt.Printf("Got response with Identification: %v", event.Products.Identification)
}
suspect := true
opts := sdk.FingerprintApiSearchEventsOpts{
// Suspect can be set by using `UpdateEvent` method
Suspect: &suspect,
PaginationKey: "1740815825085"
}
// Search for 10 events with suspect=true
searchEventsResult, httpRes, err := client.FingerprintApi.SearchEvents(auth, 10, &opts)
if searchEventsResult.Events != nil {
fmt.Printf("Got response with Events: %v \n", searchEventsResult.Events)
}
}Note You can also check examples located in example directory. To run the examples:
cd example && FINGERPRINT_API_KEY=SECRET_API_KEY VISITOR_ID=VISITOR_ID_EXAMPLE go run getVisits.goAlternatively, you can define your environment variables inside
example/.envfile and run the examples without passing them as arguments. If your subscription region is not the “Global/US” region, useREGION=euorREGION=apin the line above or in your local.envfile.
If your subscription is in region other than US, you need to change the region in the configuration:
import (
"github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk"
)
func main() {
cfg := sdk.NewConfiguration()
cfg.ChangeRegion(sdk.RegionEU) // or sdk.RegionAsia
}This SDK provides utility methods for decoding sealed results. Install the sealed results dependency as below:
go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk/sealedThen you can use below code to unseal results:
package main
import (
"encoding/base64"
"fmt"
"github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk/sealed"
"os"
)
// Utility function to decode base64 string
func base64Decode(input string) []byte {
output, err := base64.StdEncoding.DecodeString(input)
if err != nil {
panic(err)
}
return output
}
func main() {
// Sealed result from the frontend.
sealedResult := base64Decode(os.Getenv("BASE64_SEALED_RESULT"))
// Base64 encoded key generated in the dashboard.
key := base64Decode(os.Getenv("BASE64_SEALED_RESULT_KEY"))
keys := []sealed.DecryptionKey{
// You can provide more than one key to support key rotation. The SDK will try to decrypt the result with each key.
{
Key: key,
Algorithm: sealed.AlgorithmAES256GCM,
},
}
unsealedResponse, err := sealed.UnsealEventsResponse(sealedResult, keys)
if err != nil {
panic(err)
}
// Do something with unsealed response, e.g: send it back to the frontend.
fmt.Println(unsealedResponse)
}This SDK provides utility method for verifing the HMAC signature of the incoming webhook request. Install the webhook dependency as below:
go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk/webhookThen you can use below code to verify signature:
package main
import (
"github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk/webhook"
)
func main() {
// Your webhook signing secret.
secret := "secret"
// Request data. In real life scenario this will be the body of incoming request
data := []byte("data")
// Value of the "fpjs-event-signature" header.
header := "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"
isValid := webhook.IsValidWebhookSignature(header, data, secret)
if !isValid {
panic("Invalid signature")
}
}To learn more, refer to example located in example/sealedResults.go.
All URIs are relative to https://api.fpjs.io
| Class | Method | HTTP request | Description |
|---|---|---|---|
| FingerprintApi | DeleteVisitorData | Delete /visitors/{visitor_id} | Delete data by visitor ID |
| FingerprintApi | GetEvent | Get /events/{request_id} | Get event by request ID |
| FingerprintApi | GetRelatedVisitors | Get /related-visitors | Get Related Visitors |
| FingerprintApi | GetVisits | Get /visitors/{visitor_id} | Get visits by visitor ID |
| FingerprintApi | SearchEvents | Get /events/search | Get events via search |
| FingerprintApi | UpdateEvent | Put /events/{request_id} | Update an event with a given request ID |
- Botd
- BotdBot
- BotdBotResult
- BrowserDetails
- ClonedApp
- DeprecatedGeolocation
- DeveloperTools
- Emulator
- ErrorCode
- ErrorPlainResponse
- ErrorResponse
- EventsGetResponse
- EventsUpdateRequest
- FactoryReset
- Frida
- Geolocation
- GeolocationCity
- GeolocationContinent
- GeolocationCountry
- GeolocationSubdivision
- HighActivity
- Identification
- IdentificationConfidence
- IdentificationSeenAt
- Incognito
- Integration
- IntegrationSubintegration
- IpBlocklist
- IpBlocklistDetails
- IpInfo
- IpInfoAsn
- IpInfoDataCenter
- IpInfoV4
- IpInfoV6
- Jailbroken
- LocationSpoofing
- MitMAttack
- ModelError
- PrivacySettings
- ProductBotd
- ProductClonedApp
- ProductDeveloperTools
- ProductEmulator
- ProductFactoryReset
- ProductFrida
- ProductHighActivity
- ProductIdentification
- ProductIncognito
- ProductIpBlocklist
- ProductIpInfo
- ProductJailbroken
- ProductLocationSpoofing
- ProductMitMAttack
- ProductPrivacySettings
- ProductProximity
- ProductProxy
- ProductRawDeviceAttributes
- ProductRemoteControl
- ProductRootApps
- ProductSuspectScore
- ProductTampering
- ProductTor
- ProductVelocity
- ProductVirtualMachine
- ProductVpn
- Products
- Proximity
- Proxy
- ProxyConfidence
- ProxyDetails
- RawDeviceAttribute
- RawDeviceAttributeError
- RelatedVisitor
- RelatedVisitorsResponse
- RemoteControl
- RootApps
- Sdk
- SearchEventsResponse
- SearchEventsResponseEvents
- SupplementaryId
- SuspectScore
- Tampering
- Tor
- Velocity
- VelocityData
- VelocityIntervals
- VirtualMachine
- Visit
- VisitorsGetResponse
- Vpn
- VpnConfidence
- VpnMethods
- Webhook
- WebhookClonedApp
- WebhookDeveloperTools
- WebhookEmulator
- WebhookFactoryReset
- WebhookFrida
- WebhookHighActivity
- WebhookIpBlocklist
- WebhookIpInfo
- WebhookJailbroken
- WebhookLocationSpoofing
- WebhookMitMAttack
- WebhookPrivacySettings
- WebhookProximity
- WebhookProxy
- WebhookRemoteControl
- WebhookRootApps
- WebhookSupplementaryIDs
- WebhookSuspectScore
- WebhookTampering
- WebhookTor
- WebhookVelocity
- WebhookVirtualMachine
- WebhookVpn
- Type: API key
- API key parameter name: Auth-API-Key
- Location: HTTP header
- Type: API key
- API key parameter name: api_key
- Location: URL query string
To report problems, ask questions, or provide feedback, please use Issues. If you need private support, you can email us at oss-support@fingerprint.com.
This project is licensed under the MIT license.