Page Groups - Data Sources

Data sources provide the content that powers your generated pages. Each page group can have multiple data sources. SleekRank merges items from all sources when resolving pages. Seven source types are available, each suited to different workflows.

JSON URL

Fetch data from any external API endpoint. SleekRank makes an HTTP request to the URL, parses the JSON response, and maps each entry to a generated page.

Configuration

  • URL: The full URL of the API endpoint
  • Data Path: JSONPath to the array of items (e.g., data.items if your response is { data: { items: [...] } })
  • Cache Duration: How long to cache the response (in seconds)

When to use

JSON URL sources are ideal when your data lives in an external system, such as a CMS API, product database, or any service that exposes a JSON endpoint.

JSON File

Load data from a JSON file in your WordPress theme directory. The file is read directly from disk, making it fast and reliable.

Configuration

  • File Path: Path relative to your active theme directory (e.g., data/cities.json)
  • Data Path: JSONPath to the array of items within the file

When to use

JSON file sources are perfect for static or semi-static datasets that you manage alongside your theme code. Since the files are version-controlled, you get a full history of changes.

CSV URL

Fetch data from a CSV file hosted at any URL. SleekRank downloads the file, parses rows into objects using the header row as field names, and maps each row to a generated page.

Configuration

  • URL: The full URL to the CSV file
  • Delimiter: Column separator character (default: comma)
  • Has Header: Whether the first row contains column names
  • Cache Duration: How long to cache the response (in seconds)

When to use

CSV URL sources work well for data exported from spreadsheets, databases, or tools that output CSV. They're simpler than JSON when your data is flat and tabular.

CSV File

Load data from a CSV file in your WordPress theme directory. Works the same as CSV URL but reads from disk.

Configuration

  • File Path: Path relative to your active theme directory (e.g., data/products.csv)
  • Delimiter: Column separator character (default: comma)
  • Has Header: Whether the first row contains column names

REST API

Connect to any REST API with full control over the request. Supports authentication and nested JSON response parsing.

Configuration

  • URL: The API endpoint URL
  • Method: HTTP method (GET or POST)
  • Headers: Custom request headers
  • Auth Type: Authentication method (none, bearer, or api_key)
  • Auth Token: The token or API key value
  • Auth Header Name: Custom header name for API key auth (default: Authorization)
  • JSON Path: Dot notation path to the array of items in the response (e.g., results.data)
  • Cache Duration: How long to cache the response (in seconds)

When to use

REST API sources are the most flexible option for connecting to external services. Use them when you need custom headers, authentication, or the response structure requires JSON path traversal to find the data array.

Google Sheets

Pull data directly from a Google Sheets spreadsheet. Two modes are available depending on whether the sheet is public or private.

Public mode

Works with publicly shared spreadsheets without any API key. SleekRank fetches data through Google's visualization API.

API mode

For private spreadsheets, enable Use API and provide a Google Sheets API key in Settings > API Keys. This uses the Google Sheets API v4 for authenticated access.

Configuration

  • Spreadsheet ID: The ID from the Google Sheets URL (the long string between /d/ and /edit)
  • Sheet Name: The name of the specific sheet tab
  • Use API: Toggle between public and API mode
  • Cache Duration: How long to cache the response (in seconds)

When to use

Google Sheets is a great option for non-technical teams. Anyone can update the spreadsheet, and SleekRank picks up the changes on the next cache refresh. Each row becomes a generated page, with column headers as field names.

Notion

Fetch data from a Notion database. Each row in the database becomes a generated page, with property names as field names.

Configuration

  • Database ID: The Notion database ID (from the database URL)
  • Cache Duration: How long to cache the response (in seconds)

A Notion integration token must be configured in Settings > API Keys before using this source. The integration must have access to the database you want to query.

Supported property types

SleekRank converts the following Notion property types to flat values:

  • title and rich_text: Converted to plain text
  • number: Numeric value
  • select: Selected option name
  • multi_select: Comma-separated option names
  • url and email: String values
  • checkbox: Boolean (true/false)
  • date: ISO date string

Data structure

All source types expect the data to resolve to an array of objects. Each object represents one generated page. At minimum, each object needs a field that can be used as the URL slug:

cities.json
        [
  {
    "slug": "new-york",
    "name": "New York",
    "state": "NY",
    "population": "8.3M"
  },
  {
    "slug": "los-angeles",
    "name": "Los Angeles",
    "state": "CA",
    "population": "3.9M"
  }
]
  
                    
Copy

Additional fields can be used in tag, selector, list, and meta replacements.

Caching

All data sources support a configurable cache duration in seconds. When caching is enabled, SleekRank stores fetched items in a dedicated database table and serves them from cache until the duration expires. Set the cache duration to 0 to disable caching and fetch fresh data on every request.

The cache can be manually refreshed by clicking Reload Data in the data source configuration panel.

API key configuration

Google Sheets (API mode) and Notion require API credentials. Configure them in Settings > API Keys:

  • Google Sheets API Key: A Google Cloud API key with the Sheets API enabled
  • Notion Integration Token: A Notion internal integration token with database access

Both keys are validated when saved to ensure they're working correctly.