API Management

My APIs

Manage your API services. Currently, only the Product Listing API is available.

GET Product Listing

/api/listing
Active

Retrieve a filtered list of product data. Requires valid domain, apikey, and session_id.

GET /api/listing?domain={DOMAIN}&apikey={APIKEY}&session_id={SESSION_ID}&q={QUERY}

Test this API

Developer Guide

Session ID Generation Logic

The session_id must be regenerated every hour. It validates that the request is coming from an authorized time window.

Timezone: Asia/Jakarta (WIB / UTC+7)
Formula: MD5("samtigis" + current_hour_24H + domain + apikey)

PHP Implementation

<?php
$domain = "example.com";
$apikey = "YOUR_API_KEY";

// 1. Set Timezone to WIB (Asia/Jakarta)
date_default_timezone_set('Asia/Jakarta');
$currentHour = date('G'); // 0-23 format without leading zeros

// 2. Generate Hash
$stringToHash = "samtigis" . $currentHour . $domain . $apikey;
$sessionId = md5($stringToHash);

// 3. Make Request (Example with cURL)
$url = "https://apps.samtigis.id/api/listing";
$params = [
    'domain' => $domain,
    'apikey' => $apikey,
    'session_id' => $sessionId,
    'q' => 'sewa bus'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

Node.js / JavaScript Implementation

const crypto = require('crypto');
const axios = require('axios'); // or fetch

const domain = "example.com";
const apikey = "YOUR_API_KEY";

// 1. Get WIB Hour
const now = new Date();
// Format to Asia/Jakarta, get Hour only
const wibHourStr = now.toLocaleString('en-US', { 
    timeZone: 'Asia/Jakarta', 
    hour: 'numeric', 
    hour12: false 
});
const currentHour = parseInt(wibHourStr);

// 2. Generate Hash
const rawString = `samtigis${currentHour}${domain}${apikey}`;
const sessionId = crypto.createHash('md5').update(rawString).digest('hex');

// 3. Make Request
axios.get('https://apps.samtigis.id/api/listing', {
    params: {
        domain,
        apikey,
        session_id: sessionId,
        q: 'sewa bus'
    }
}).then(res => console.log(res.data));