Fingerprint is a device intelligence platform offering 99.5% accurate visitor identification. The Fingerprint Server Python SDK is an easy way to interact with the Fingerprint Server API from your Python application. You can retrieve visitor history or individual identification events.
This Python package is automatically generated by the Swagger Codegen project:
- API version: 3
- Package version: 6.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
The following Python versions are supported:
- Python >= 3.8
You can install the package directly from the Github
pip install git+https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk.git
Or from the PyPI
pip install fingerprint_pro_server_api_sdk
Then import the package:
import fingerprint_pro_server_api_sdk
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import fingerprint_pro_server_api_sdk
Please follow the installation procedure and then run the following:
import fingerprint_pro_server_api_sdk
# Configure API key authorization and region
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
# configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY", region="eu")
# create an instance of the API class
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)
Fetching visits using visitorId:
import fingerprint_pro_server_api_sdk
from fingerprint_pro_server_api_sdk import Response
from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)
visitor_id = 'visitor_id_example' # str |
#request_id = 'request_id_example' # str | Filter events by requestId (optional)
#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional)
limit = 10 # int | Limit scanned results (optional)
#before = 56 # int | Used to paginate results (optional)
try:
api_response: Response = api_instance.get_visits(visitor_id, limit=2)
print(api_response)
except KnownApiException as e:
structured_error = e.structured_error
print("Error: %s\n" % structured_error.error)
except ApiException as e:
print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e)
Fetching events for requestId:
import fingerprint_pro_server_api_sdk
from fingerprint_pro_server_api_sdk import EventResponse
from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)
request_id = 'request_id_example' # str
try:
events_response: EventResponse = api_instance.get_event(request_id)
except KnownApiException as e:
structured_error = e.structured_error
print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message))
except ApiException as e:
print("Exception when calling DefaultApi->get_event: %s\n" % e)
This SDK provides utility methods for decoding sealed results.
import base64
import os
from dotenv import load_dotenv
from fingerprint_pro_server_api_sdk import EventResponse
from fingerprint_pro_server_api_sdk.sealed import unseal_events_response, DecryptionKey, DecryptionAlgorithm
load_dotenv()
sealed_result = base64.b64decode(os.environ["BASE64_SEALED_RESULT"])
key = base64.b64decode(os.environ["BASE64_KEY"])
try:
events_response: EventResponse = unseal_events_response(sealed_result, [DecryptionKey(key, DecryptionAlgorithm['Aes256Gcm'])])
print("\n\n\nEvent response: \n", events_response.products)
except Exception as e:
print("Exception when calling unsealing events response: %s\n" % e)
exit(1)
print("Unseal successful!")
exit(0)
To learn more, refer to example located in sealed_results_example.py.
All URIs are relative to https://api.fpjs.io
Class | Method | HTTP request | Description |
---|---|---|---|
FingerprintApi | get_event | GET /events/{request_id} | Get event by requestId |
FingerprintApi | get_visits | GET /visitors/{visitor_id} | Get visits by visitorId |
- ASN
- BotdDetectionResult
- BotdResult
- BrowserDetails
- ClonedAppResult
- Confidence
- DataCenter
- DeprecatedIPLocation
- DeprecatedIPLocationCity
- EmulatorResult
- ErrorEvent403Response
- ErrorEvent403ResponseError
- ErrorEvent404Response
- ErrorEvent404ResponseError
- ErrorVisits403
- EventResponse
- FactoryResetResult
- FridaResult
- HighActivityResult
- IPLocation
- IPLocationCity
- IdentificationError
- IncognitoResult
- IpBlockListResult
- IpBlockListResultDetails
- IpInfoResult
- IpInfoResultV4
- IpInfoResultV6
- JailbrokenResult
- Location
- LocationSpoofingResult
- ManyRequestsResponse
- PrivacySettingsResult
- ProductError
- ProductsResponse
- ProductsResponseBotd
- ProductsResponseIdentification
- ProductsResponseIdentificationData
- ProxyResult
- RawDeviceAttributesResult
- Response
- ResponseVisits
- RootAppsResult
- SeenAt
- SignalResponseClonedApp
- SignalResponseEmulator
- SignalResponseFactoryReset
- SignalResponseFrida
- SignalResponseHighActivity
- SignalResponseIncognito
- SignalResponseIpBlocklist
- SignalResponseIpInfo
- SignalResponseJailbroken
- SignalResponseLocationSpoofing
- SignalResponsePrivacySettings
- SignalResponseProxy
- SignalResponseRawDeviceAttributes
- SignalResponseRootApps
- SignalResponseSuspectScore
- SignalResponseTampering
- SignalResponseTor
- SignalResponseVirtualMachine
- SignalResponseVpn
- Subdivision
- SuspectScoreResult
- TamperingResult
- TorResult
- VirtualMachineResult
- Visit
- VpnResult
- VpnResultMethods
- WebhookVisit
- 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.