Introduction
Torziva Sync is a powerful web-to-API platform that allows you to turn any website into a structured REST API using a single line of code. No backends, no scrapers, and no complex configuration required.
By embedding our lightweight SDK, Torziva Sync automatically detects products, articles, pricing, and availability data as your users browse your site, keeping your external databases always in sync.
Quick Start
Create an Account
Sign up at torziva.site to get your primary dashboard access.
Register a Project
Add your website domain. Each project gets a unique Public Key.
Install the SDK
Copy the script tag and paste it into your website's <head> section.
Sync Data
Simply browse your website. Our SDK will detect and sync content automatically.
Call the API
Generate an API Secret Key and start pulling data via standard HTTPS requests.
Installation
To start syncing, place the following script tag as early as possible in your HTML, ideally within the <head> tag.
<script
async
src="https://app.torziva.site/sdk.js?key=pk_live_xxxx">
</script>Global Scope
Auto-Detection
Our SDK uses a proprietary heuristic engine to find content. It scans the following in order of priority:
Manual Selectors
If your site has a custom structure that prevents auto-detection, you can define **CSS Selectors** in the Project Dashboard.
.product-hero h1span[data-price]Content Attributes
The following attributes are synchronized for every content item discovered:
| Attribute | Type | Description |
|---|---|---|
| title | String | The primary name or heading. |
| price | String | Raw price value including symbol. |
| type | Enum | product, article, service, etc. |
| image_url | URL | Main representative image. |
Authentication
All REST API requests must include your API credentials in the request headers. Keep your **Secret Key** private.
const response = await fetch('https://api.torziva.site/v1/contents', {
headers: {
'x-api-key': 'pk_live_xxxx',
'x-api-secret': 'sk_live_xxxx'
}
});Webhooks
Webhooks are asynchronous POST requests sent to your server whenever Torziva Sync detects new or updated content.
{
"event": "content.synced",
"project_id": "8f3a...d2",
"timestamp": "2025-04-29T16:25:00Z",
"data": {
"title": "Modern Desk Lamp",
"price": "$45.00",
"type": "product",
"url": "https://store.com/lamp"
}
}Verifying Signatures
To ensure a webhook was sent by Torziva Sync, we include a signature in the X-Torziva-Signature header.
Security First
const crypto = require('crypto');
const signature = req.headers['x-torziva-signature'];
const payload = JSON.stringify(req.body);
const expected = crypto
.createHmac('sha256', process.env.TORZIVA_SECRET)
.update(payload)
.digest('hex');
if (signature === expected) {
// Request is authentic
}Manual Testing
You can test your webhook integration without having to sync real data. Use the **"Send Test"** button in the Webhooks tab of your dashboard.
The "Send Test" feature sends a sample payload with "test": true and a valid signature to your endpoint instantly.