Documentation

GetSeoPages

Retrieve SEO pages via the Backend API.

GetSeoPages

Backend API to retrieve SEO page data programmatically. Usage is charged from your credit balance.

Server-side only. getSeoPages and the raw API must be called from the server only. Never use them in client-side code (e.g. React components, browser JavaScript)—the secret key would be exposed. Use API routes, server actions, or backend scripts instead.

Properties

PropertyTypeRequiredDescription
pageIdentifiersPageIdentifiersYesA PageIdentifiers object to identify which page to retrieve.

PageIdentifiers

PropertyTypeRequiredDescription
pathstringYesThe page path. Must begin with '/'.
pageIdstringNoThe pageId of the SEO page. Optional alternative to path for identifying a page.

You can identify a page by path (required) or optionally include pageId for more precise matching.

API Reference

Endpoint: POST https://v1.seomanager.dev/backend_api/seo/getSeoPages

Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
x-projectidYesYour project ID.
x-projectkeyYesYour project key.
x-projectsecretkeyYesYour secret key. Keep this private and never expose it client-side.

Request Body

{
  "pageIdentifiers": { "path": "/example" }
}

Response Shape

// Success
{
  message: "Successful",
  results: { succeeded: true, paths: string[] },
  error: false
}

// Error
{ results: false, error: true, message: "Error description" }

paths is an array of page paths that match the pageIdentifiers.path (used as a prefix/regex match).

Examples

cURL

curl -X POST https://v1.seomanager.dev/backend_api/seo/getSeoPages \
  -H "Content-Type: application/json" \
  -H "x-projectid: YOUR_PROJECT_ID" \
  -H "x-projectkey: YOUR_PROJECT_KEY" \
  -H "x-projectsecretkey: YOUR_SECRET_KEY" \
  -d '{"pageIdentifiers":{"path":"/example"}}'

Python

import requests

url = "https://v1.seomanager.dev/backend_api/seo/getSeoPages"
headers = {
    "Content-Type": "application/json",
    "x-projectid": "YOUR_PROJECT_ID",
    "x-projectkey": "YOUR_PROJECT_KEY",
    "x-projectsecretkey": "YOUR_SECRET_KEY",
}
payload = {"pageIdentifiers": {"path": "/example"}}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

PHP

<?php
$url = "https://v1.seomanager.dev/backend_api/seo/getSeoPages";
$payload = ["pageIdentifiers" => ["path" => "/example"]];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "x-projectid: YOUR_PROJECT_ID",
    "x-projectkey: YOUR_PROJECT_KEY",
    "x-projectsecretkey: YOUR_SECRET_KEY",
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);
echo $response;

Node.js (fetch)

const response = await fetch("https://v1.seomanager.dev/backend_api/seo/getSeoPages", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-projectid": process.env.SEO_MANAGER_PROJECT_ID,
    "x-projectkey": process.env.SEO_MANAGER_PROJECT_KEY,
    "x-projectsecretkey": process.env.SEO_MANAGER_SECRET_KEY,
  },
  body: JSON.stringify({
    pageIdentifiers: { path: "/example" },
  }),
});
const data = await response.json();
if (data.error) {
  // Handle error
}

Node.js with nextjs-seo-manager (Next.js)

These examples run in API routes (server-side only)—never in client components.

Pages Router (API route)

// pages/api/get-seo.js
import SEOInit from "nextjs-seo-manager/init";
import { getSeoPages } from "nextjs-seo-manager";

SEOInit({
  projectId: process.env.SEO_MANAGER_PROJECT_ID,
  secretKey: process.env.SEO_MANAGER_SECRET_KEY,
});

export default async function handler(req, res) {
  try {
    const response = await getSeoPages({ path: "/example" });
    if (response.error) {
      return res.status(400).json(response);
    }
    return res.status(200).json(response);
  } catch (err) {
    return res.status(500).json({ error: err.message });
  }
}

App Router (API route)

// app/api/get-seo/route.ts
import { NextRequest, NextResponse } from "next/server";
import SEOInit from "nextjs-seo-manager/init";
import { getSeoPages } from "nextjs-seo-manager";

SEOInit({
  projectId: process.env.SEO_MANAGER_PROJECT_ID,
  secretKey: process.env.SEO_MANAGER_SECRET_KEY,
});

export async function POST(request: NextRequest) {
  try {
    const { path, pageId } = await request.json();
    const response = await getSeoPages({ path, pageId });
    if (response.error) {
      return NextResponse.json(response, { status: 400 });
    }
    return NextResponse.json(response);
  } catch (err: any) {
    return NextResponse.json({ error: err.message }, { status: 500 });
  }
}
Explore

More documentation

Getting Started

Set up nextjs-seo-manager for your Next.js project.