Hi

If anyone knows some opensource api or tutorials..

Look on the right- it says "Public stats" how do you display that information for a domain - how do buysellads do that domain api?

Dani AI

Generated

Short answer for (and building on ’s point about external widgets): Google does not provide a public PageRank API anymore — the 0–10 toolbar PageRank feed was switched off in 2016 — so any code that scrapes the old toolbar endpoints will fail or return cached/estimated values. Likewise, Alexa.com (and its public APIs) was retired by Amazon in 2022, so Alexa rank is no longer a live data source.

Practical replacements you can use today:

  • For a PageRank‑style, public score: OpenPageRank (OPR) offers a REST API (API key required).
  • For site traffic / rank estimates: SimilarWeb’s DigitalRank API (they offer a small free credit tier).
  • For link/authority metrics: paid providers (Moz, Majestic, Ahrefs) all provide APIs; Majestic documents its developer endpoints (Trust/Citation Flow etc.).
  • For owner-only, authoritative search metrics (clicks, impressions): Google Search Console API.
    Pick one or two providers and combine results into a single “public stats” panel rather than chasing the old Google/Alexa feeds.

How to build it (server-side, PHP workflow):

  1. Choose APIs and register for keys.
  2. Server-side cron job fetches each metric, writes a small cached record (DB or Redis) and timestamps it.
  3. In your page template read cached values and show badges; fall back to “N/A” if stale.
  4. Respect rate limits, cache aggressively (hourly/daily depending on metric) and log failures.

Minimal PHP example (OpenPageRank call):

<?php
$apiKey = 'YOUR_API_KEY';
$domains = ['example.com'];
$url = 'https://openpagerank.com/api/v1.0/getPageRank?' . http_build_query(['domains' => $domains]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['API-OPR: ' . $apiKey]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close($ch);
$data = json_decode($json, true);
$rank = $data['response'][0]['page_rank_integer'] ?? 'N/A';
echo $rank;

That pattern is essentially what ad marketplaces use: aggregate multiple third‑party endpoints, cache server‑side, and surface a compact “public stats” widget. For production, add retry/backoff, per‑domain caching, and request throttling.

Recommended Answers

All 3 Replies

Hi

If anyone knows some opensource api or tutorials..

Look on the right- it says "Public stats" how do you display that information for a domain - how do buysellads do that domain api?

These are external plugins you need to embed in your code to show those counts.
Probably you won't get them all at one place.
Have a look here-
count of "twitter followers",
count of rss feed subscribers,
and
count of delicious bookmarks another
Hope those will help you the way you expect.

Hi

Thanks for the reply. Do you know how to display the Google PageRank update API aswell in the code? I really want to show Google Pagerank..

Thanks

Hi

Thanks for the reply. Do you know how to display the Google PageRank update API aswell in the code? I really want to show Google Pagerank..

Thanks

pagerank and
and still there are many more.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.