s = Sherlock(priv)
sSherlock(pubkey=90ba884688884277e49080712f386eebc88806efa8345ca937f75fe80950156d)
This is the main class for the SDK. If a private key is not provided, we will try to load it from the config file. If neither the private key nor the config file is provided, we will generate a new one and store it in the config file.
Sherlock client class to interact with the Sherlock API.
Let’s do an authenticated request to verify we’re authenticated.
(<Response [200 OK]>,
{'logged_in': True,
'email': 'jordi@fewsats.com',
'public_key': '90ba884688884277e49080712f386eebc88806efa8345ca937f75fe80950156d'})
Get authenticated user information
Accounts created by AI Agents can link an email. After confirming the account users will be able log in and use the web interface for Sherlock Domains.
An email cannot be claimed more than once.
Claim an account by linking an email address
Search domains returns domain availability and its prices in USD cents.
Search for domains with a query. Returns prices in USD cents.
{'id': 'd1805b55-d448-4d1d-94ff-97e4e3e7642e',
'created_at': '2025-03-18T08:58:56.382Z',
'available': [{'name': 'trakwiska.net',
'tld': 'net',
'tags': [],
'price': 1185,
'currency': 'USD',
'available': True}],
'unavailable': []}
Contact information is required for ICANN domain registration and billing.
Contact information for a domain purchase
Get the contact information for the Sherlock user.
Set the contact information for the Sherlock user
Check if the contact information is valid
(<Response [422 Unprocessable Content]>,
'{"detail": [{"type": "missing", "loc": ["body", "data", "first_name"], "msg": "Field required"}, {"type": "missing", "loc": ["body", "data", "last_name"], "msg": "Field required"}]}')
(Contact(first_name='Test', last_name='User', email='test@example.com', address='123 Test St', city='Test City', state='CA', postal_code='12345', country='US'),
True)
{'message': 'Contact information updated successfully'}
A purchase needs to be linked to a search id. The purchase flow implements the L402 protocol. The flow has two steps:
{'domain': 'trakwiska.com',
'contact_information': {'first_name': 'Test',
'last_name': 'User',
'email': 'test@example.com',
'address': '123 Test St',
'city': 'Test City',
'state': 'CA',
'postal_code': '12345',
'country': 'US'},
'search_id': 'd1805b55-d448-4d1d-94ff-97e4e3e7642e'}
(<Response [402 Payment Required]>,
{'version': '0.2.1',
'payment_request_url': 'https://api.sherlockdomains.com/api/v0/payments/l402/payment_request',
'payment_context_token': '90ba884688884277e49080712f386eebc88806efa8345ca937f75fe80950156d',
'offers': [{'id': 'c377d60a-af98-48fd-a258-70c22de2d95c',
'title': 'trakwiska.com',
'description': 'Purchase trakwiska.com for 11.05 USD',
'type': 'one-time',
'amount': 1105,
'currency': 'USD',
'payment_methods': ['credit_card', 'lightning']}]})
Request available payment options for a domain.
Requesting a purchase will return a list of available offers and payment methods.
{'version': '0.2.1',
'payment_request_url': 'https://api.sherlockdomains.com/api/v0/payments/l402/payment_request',
'payment_context_token': '90ba884688884277e49080712f386eebc88806efa8345ca937f75fe80950156d',
'offers': [{'id': '533f89b7-67fa-48fe-9517-5ae32ce89d65',
'title': 'trakwiska.com',
'description': 'Purchase trakwiska.com for 11.05 USD',
'type': 'one-time',
'amount': 1105,
'currency': 'USD',
'payment_methods': ['credit_card', 'lightning']}]}
In order to pay for the domain you will have to request the payment details of the offer you want to pay for.
(<Response [200 OK]>,
{'payment_method': {'checkout_url': 'https://checkout.stripe.com/c/pay/cs_live_a1Om85Efvv1lgfE8BbhUNibQyzwoEfG8qvKPeOVoSt5tv0wx2rxcgiKofV#fidkdWxOYHwnPyd1blppbHNgWjA0S3VzXDdBbTFNVlJzfDVRQVQ2dVdBTnJTSH1QMGs2dHRsanJMbkY0PTxKbUtRaWowT2NwMGM8RlVBbGRqSWo3UFYwcVdqR3F9N2BtM2ZTPXc1Z3dQXGc2NTVPYVVSQkM8bycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl',
'lightning_invoice': None},
'expires_at': '2025-01-14T04:04:35.484Z'})
Get payment details for an offer.
Request payment information for purchasing a domain. Returns the details needed to complete the payment (like a checkout URL).
The X402 purchase flow uses the X402 protocol (USDC on Base blockchain via Coinbase CDP). The flow has two steps:
PaymentRequired schema)PAYMENT-SIGNATURE header (produced externally, e.g. via the x402 Python library)Request X402 payment requirements for a domain purchase.
Complete an X402 domain purchase with a payment signature.
List of domains owned by the authenticated user
[{'id': 'd9b2cc30-c15d-44b9-9d39-5d33da504484',
'domain_name': 'h402.org',
'created_at': '2024-12-28T18:58:49.899Z',
'expires_at': '2025-05-11T00:00:00Z',
'auto_renew': False,
'locked': True,
'private': True,
'nameservers': ['paislee.ns.cloudflare.com', 'trevor.ns.cloudflare.com'],
'status': 'active'},
{'id': 'ed6fa317-81dd-42ec-91b1-7b4702e1e5ab',
'domain_name': 'l402.org',
'created_at': '2025-02-04T06:35:03.956Z',
'expires_at': '2025-05-03T00:00:00Z',
'auto_renew': True,
'locked': True,
'private': True,
'nameservers': [],
'status': 'active'},
{'id': '203e13d0-d5cd-477e-a6b8-199f2d6264aa',
'domain_name': 'smartcheckout.dev',
'created_at': '2025-06-24T04:40:19.830Z',
'expires_at': '2025-06-24T04:54:45.281Z',
'auto_renew': False,
'locked': True,
'private': True,
'nameservers': [],
'status': 'active'}]
Update the nameserver list for a domain
{'domains': ['h402.org'], 'success': True}
Get DNS records for a domain.
{'domain': 'h402.org',
'records': [{'id': '8c1df0e3ad7ff4b30695a11e20d84b72',
'type': 'A',
'name': 'h402.org',
'value': '76.76.21.21',
'ttl': 3600}]}
Create a new DNS record
('b22820c45b6f2a48461c3a52ca486b5a',
{'domain': 'h402.org',
'records': [{'id': 'b22820c45b6f2a48461c3a52ca486b5a',
'type': 'TXT',
'name': 'test-sherlock',
'value': 'hello-world',
'ttl': 3600}]})
{'domain': 'h402.org',
'records': [{'id': '8c1df0e3ad7ff4b30695a11e20d84b72',
'type': 'A',
'name': 'h402.org',
'value': '76.76.21.21',
'ttl': 3600},
{'id': 'b22820c45b6f2a48461c3a52ca486b5a',
'type': 'TXT',
'name': 'test-sherlock.h402.org',
'value': 'hello-world',
'ttl': 3600}]}
Update a DNS record
('3944584c93667d49c774e7823a039cd8',
{'domain': 'h402.org',
'records': [{'id': '3944584c93667d49c774e7823a039cd8',
'type': 'TXT',
'name': 'test-sherlock',
'value': 'hello-world-updated',
'ttl': 3600}]})
Delete a DNS record
{'domain': 'h402.org', 'deleted_records': ['3944584c93667d49c774e7823a039cd8']}
We expose Sherlock’s core functionality as tools for AI agents. Note that payment handling for L402 offers requires additional tools like fewsats.Client().pay.
Return the Sherlock class as a list of tools ready for agents to use
Return the Sherlock class as a list of tools ready for agents to use
You can use the Sherlock class as a CLI tool.
❯ sherlock
usage: sherlock [-h] {me,set_contact_information,get_contact_information,search,purchase_domain,domains,dns_records,create_dns,update_dns,delete_dns} ...
positional arguments:
{me,set_contact_information,get_contact_information,search,purchase_domain,domains,dns_records,create_dns,update_dns,delete_dns}
me Get authenticated user information
set_contact_information
Set the contact information for the Sherlock user
get_contact_information
Get the contact information for the Sherlock user.
search Search for domains with a query. Returns prices in USD cents.
purchase_domain Request payment information for purchasing a domain. Returns the details needed to complete the payment (like a checkout URL).
domains List of domains owned by the authenticated user
dns_records Get DNS records for a domain.
create_dns Create a new DNS record
update_dns Update a DNS record
delete_dns Delete a DNS record
options:
-h, --help show this help message and exitCLI interface for Sherlock