API

ASLANTM API

Small endpoints behind aslantm.com. Every endpoint lives under https://aslantm.com/api, speaks JSON and is listed on this page.

Endpoints

Requests and responses use JSON. Errors return { "ok": false, "error": "..." } with a matching status code.

Endpoints marked API key expect the key in an x-api-key header.

GETPOST/api/notify

Public

Visit & link notifications

Sends a Telegram message when someone visits one of your sites or clicks a tagged link. Open to any site: call it from the browser with notify.js, or directly with GET (query string) or POST (JSON body), from a page, a server or a script.

Parameters

sitequery or body · string · required
Site the visit belongs to, e.g. aslantm.com. For browser calls it falls back to the page's origin; notify.js sends the hostname.
fromquery or body · string
Where the link was placed, e.g. instagram or rojdaofficial.com. Up to 80 characters.
messagequery or body · string
Extra label for the link, e.g. bio or footer. Up to 80 characters.
pathquery or body · string
Page that was opened, e.g. /about.
referrerquery or body · string
Referring URL (document.referrer); only its host is shown. Empty means a direct visit.

Responses

200
{ "ok": true, "sent": true, "visit": "<token>" } — or "sent": false with a reason ("bot", "throttled"). The visit token is used for the visit report.
302
When the link is opened in a browser: after sending, redirects to https://<site><path>.
400
{ "ok": false, "error": ... } — site is missing.
502
Telegram did not accept the message.
  • CORS is open (Access-Control-Allow-Origin: *), so any site can call it.
  • Every visit is also saved to the ASLANTM visit log, with visit counts per site, per day and per tagged link.
  • Clicked in a browser, the link sends the message and redirects the visitor to the site, so it works on sites without notify.js too. fetch, curl and servers get JSON instead.
  • notify.js notifies once per browser session for plain visits and every time for tagged links (?from=...&message=..., or utm_source / utm_campaign). It removes from/message from the address bar afterwards; utm_* stays for analytics.
  • Search engines and link-preview bots (WhatsApp, Telegram, Slack...) are ignored, so sharing a link does not trigger a message.
  • The same visitor, site and link within 30 seconds is sent once; at most 30 messages a minute.
  • Open a site with notify.js once with ?notrack to stop notifications from that browser; ?track turns them back on.
Add to any site
<script src="https://aslantm.com/notify.js" defer></script>
Shareable link (opens the site after notifying)
https://aslantm.com/api/notify?site=aslantm.com&from=instagram&message=bio
GET
curl "https://aslantm.com/api/notify?site=aslantm.com&from=instagram&message=bio"
POST
fetch("https://aslantm.com/api/notify", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ site: "aslantm.com", from: "instagram", message: "bio" }),
});
Tagged links (with notify.js on the site)
https://aslantm.com/?from=instagram&message=bio
https://muhammedaslan.net/?from=rojdaofficial.com&message=footer
Response
{ "ok": true, "sent": true, "visit": "1234.Xy9…" }
Telegram message
New visit
Site: muhammedaslan.net
Page: /
Source: rojdaofficial.com
Message: footer
Referrer: rojdaofficial.com
Location: Istanbul, Türkiye
Device: iPhone · Instagram app
Time: 21 Nov 2026, 20:45 (Istanbul)

POST/api/notify

Public

Visit report

When the visitor leaves, posts a report as a reply under the visit's arrival message: pages with time on each, total time, deepest scroll and outbound clicks. notify.js sends it automatically when the tab is hidden or closed; if the visitor comes back and leaves again, the same report is updated.

Parameters

typebody · "report" · required
Marks the request as a report.
visitbody · string · required
The visit token from the arrival response (or the notified= parameter after a shared API link).
reportbody · string
Token from a previous report response; the existing report is edited instead of posting a new one.
sitebody · string
Site hostname, e.g. aslantm.com.
pagesbody · { path, t }[] · required
Pages in the order visited, with visible time in milliseconds.
scrollbody · { pct, path }
Deepest scroll in percent and the page it was on.
clicksbody · string[]
Outbound clicks, e.g. email, instagram.com.

Responses

200
{ "ok": true, "sent": true, "report": "<token>" }
400
pages is empty.
403
The visit token is missing or invalid.
  • Tokens are signed on the server, so a report can only be attached to a real arrival message.
  • Time counts only while the page is visible. If the browser is closed abruptly (for example the app is killed), the report may not arrive; the arrival message always does.
Request
{
  "type": "report",
  "visit": "1234.Xy9…",
  "site": "aslantm.com",
  "pages": [{ "path": "/", "t": 40000 }, { "path": "/about", "t": 70000 }, { "path": "/api", "t": 112000 }],
  "scroll": { "pct": 85, "path": "/about" },
  "clicks": ["email", "instagram.com"]
}
Telegram reply
Visit report
Site: aslantm.com
Duration: 3m 42s
Pages: 3
  / · 40s
  /about · 1m 10s
  /api · 1m 52s
Scroll: 85% (/about)
Clicks: email, instagram.com
Exit page: /api