Skip to content

Show P3 Index on your portal in 5 minutes

From a test key to an index line on your page, cached so you call the API only when the index changes.

Get a test key

An admin of your organisation creates one in P3: Organisation → Developers → Keys, environment Test, scope index:read. Keep it on your server.

List the areas

Each area has a slug, its name in English and Arabic, and its latest price and rent index.

curl https://api.pthree.vip/v1/areas?city=dubai \
  -H "Authorization: Bearer $P3_API_KEY"

Fetch an area's index

Monthly levels, oldest first, with the 90% range. The base month is 100. Use from and to for a window.

curl "https://api.pthree.vip/v1/index/price?area=dubai-marina&from=2025-01" \
  -H "Authorization: Bearer $P3_API_KEY"

Draw it on your page

Render on your server, so the key never reaches a browser. Show the source: the Open plan asks you to credit the P3 Index.

// A server-rendered line for your page (no chart library needed).
function indexLine(points, width = 600, height = 160) {
  const values = points.map((p) => p.value);
  const min = Math.min(...values), max = Math.max(...values);
  const x = (i) => (i / (points.length - 1)) * width;
  const y = (v) => height - ((v - min) / (max - min || 1)) * height;
  const d = points.map((p, i) => `${i ? "L" : "M"}${x(i).toFixed(1)},${y(p.value).toFixed(1)}`).join(" ");
  const last = points.at(-1);
  return `<figure>
  <svg viewBox="0 0 ${width} ${height}" role="img" aria-label="P3 Price Index, ${points[0].period} to ${last.period}">
    <path d="${d}" fill="none" stroke="#0E7C66" stroke-width="2"/>
  </svg>
  <figcaption>P3 Price Index: ${last.value} in ${last.period}. Source: P3 Index.</figcaption>
</figure>`;
}

Cache with the ETag

The index is published monthly, so most calls change nothing. Send the ETag back as If-None-Match and P3 answers 304 Not Modified.

# The second call answers 304 Not Modified while the index is unchanged.
curl -i "https://api.pthree.vip/v1/index/price?area=dubai-marina" \
  -H "Authorization: Bearer $P3_API_KEY" \
  -H 'If-None-Match: W/"3ea39a99cfc35230"'

When it works, swap the test key for a live one. Nothing else changes.

We use necessary cookies to run this site. With your permission we also use analytics to see which pages help, and marketing cookies to measure campaigns. Read the cookie notice