Skip to content
Open Onsite

API reference

Get portfolio performance

GET
/portfolios/{portfolio}/performance
Code sample: curl
curl "https://api.onsite.so/api/v1/portfolios/Clients/performance" \
-H "Authorization: Bearer $ONSITE_API_KEY"

Returns a portfolio’s Search Console totals for all its sites together and for each one, with the comparison. Sites with missing days are shown but left out of the total. Needs a key that can read every site.

portfolio
required
string

Example

Clients

The portfolio’s name or ID, as List portfolios shows them.

range
string
default: last_28d <= 40 characters

The period: last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter or year_to_date, or two dates like 2026-08-01..2026-08-31. Presets end on the latest day with complete data.

compare
string
default: previous_period
Allowed values: previous_period previous_year none

What to compare with: the same number of days just before (previous_period), the same days a year earlier with weekdays matched (previous_year), or nothing (none).

OK

Media typeapplication/json
object
portfolio
required

The portfolio’s name.

string
period
required
Any of:

The dates the numbers cover, in the site’s Search Console time zone (Pacific Time).

object
from
required

First day of the period.

string format: date
to
required

Last day of the period. Presets end on the latest day with complete data.

string format: date
days
required

Number of days in the period.

integer
comparison
required

The period compared with, or null when compare is none or Search Console no longer keeps those dates.

Any of:

The dates the numbers cover, in the site’s Search Console time zone (Pacific Time).

object
from
required

First day of the period.

string format: date
to
required

Last day of the period. Presets end on the latest day with complete data.

string format: date
days
required

Number of days in the period.

integer
totals
required

All its sites together, or null when it has no sites. Sites with missing days or overlapping properties are left out of the total.

Any of:

Totals for the whole period.

object
clicks
required

Clicks from Google Search.

integer
impressions
required

Times a page of the site was shown in Google Search.

integer
ctr
required
Any of:

Click-through rate in percent, to one decimal: clicks divided by impressions.

number
position
required
Any of:

Average position in Google Search results, weighted by impressions. Lower is better. Null for search types without positions.

number
previous
required

The same numbers for the comparison period, or null without one.

Any of:
object
clicks
required

Clicks from Google Search.

integer
impressions
required

Times a page of the site was shown in Google Search.

integer
ctr
required
Any of:

Click-through rate in percent, to one decimal: clicks divided by impressions.

number
position
required
Any of:

Average position in Google Search results, weighted by impressions. Lower is better. Null for search types without positions.

number
change
required

How the period compares with the comparison period, or null without one.

Any of:
object
clicks
required
Any of:

Change in clicks, in percent.

number
impressions
required
Any of:

Change in impressions, in percent.

number
ctrPoints
required
Any of:

Change in click-through rate, in percentage points.

number
positionPlaces
required
Any of:

Places gained in average position. Positive means the site moved up.

number
sites
required

Each site, most clicks first.

Array<object>
default:
object
site
required

The site’s address, as Search Console names the property.

string
dataThrough

The latest complete day for this site.

string format: date
completeDays

Days of the period this site has complete data for.

integer
status
required

Complete: every day of the period is in. partial: some days are missing, so it is left out of the total.

string
Allowed values: complete partial preliminary
clicks
required

Clicks from Google Search.

integer
impressions
required

Times a page of the site was shown in Google Search.

integer
ctr
required
Any of:

Click-through rate in percent, to one decimal: clicks divided by impressions.

number
position
required
Any of:

Average position in Google Search results, weighted by impressions. Lower is better. Null for search types without positions.

number
previous
required

The same numbers for the comparison period, or null without one.

Any of:
object
clicks
required

Clicks from Google Search.

integer
impressions
required

Times a page of the site was shown in Google Search.

integer
ctr
required
Any of:

Click-through rate in percent, to one decimal: clicks divided by impressions.

number
position
required
Any of:

Average position in Google Search results, weighted by impressions. Lower is better. Null for search types without positions.

number
change
required

How the period compares with the comparison period, or null without one.

Any of:
object
clicks
required
Any of:

Change in clicks, in percent.

number
impressions
required
Any of:

Change in impressions, in percent.

number
ctrPoints
required
Any of:

Change in click-through rate, in percentage points.

number
positionPlaces
required
Any of:

Places gained in average position. Positive means the site moved up.

number
excludedFromTotal
required

Why the site is left out of the total, or null when it counts.

Any of:
string
Allowed values: overlapping_property partial
share
required
Any of:

Its part of the portfolio’s clicks, in percent.

number

Example

{
"portfolio": "Clients",
"period": {
"from": "2026-09-30",
"to": "2026-10-27",
"days": 28
},
"comparison": {
"from": "2026-09-30",
"to": "2026-10-27",
"days": 28
},
"totals": {
"clicks": 1840,
"impressions": 96210,
"ctr": 1.9,
"position": 14.2,
"previous": {
"clicks": 1840,
"impressions": 96210,
"ctr": 1.9,
"position": 14.2
},
"change": {
"clicks": 12.4,
"impressions": 3.1,
"ctrPoints": 0.2,
"positionPlaces": 1.3
}
},
"sites": []
}

A parameter or body field isn’t valid. error.param names it.

Media typeapplication/json
object
error
required
object
code
required

What went wrong, as a stable word your code can check.

string
Allowed values: invalid_input unauthenticated forbidden not_found payment_required credits_exhausted conflict rate_limited quota_limited search_data_unavailable search_data_changed google_access_lost maintenance internal
message
required

What went wrong, in a sentence a person can act on.

string
param

The parameter or body field at fault, when there is one.

string
allowed

The values it accepts, when there is a fixed set.

Array<string>
didYouMean

The closest allowed value, when the one sent looks like a typo.

string
requestId
required

Quote it to support to find this request.

string

Example

{
"error": {
"code": "invalid_input",
"message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.",
"param": "range",
"didYouMean": "last_28d",
"requestId": "E-7K2Q-M4XD"
}
}

The API key is missing, wrong, expired or revoked.

Media typeapplication/json
object
error
required
object
code
required

What went wrong, as a stable word your code can check.

string
Allowed values: invalid_input unauthenticated forbidden not_found payment_required credits_exhausted conflict rate_limited quota_limited search_data_unavailable search_data_changed google_access_lost maintenance internal
message
required

What went wrong, in a sentence a person can act on.

string
param

The parameter or body field at fault, when there is one.

string
allowed

The values it accepts, when there is a fixed set.

Array<string>
didYouMean

The closest allowed value, when the one sent looks like a typo.

string
requestId
required

Quote it to support to find this request.

string

Example

{
"error": {
"code": "invalid_input",
"message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.",
"param": "range",
"didYouMean": "last_28d",
"requestId": "E-7K2Q-M4XD"
}
}

Your team needs an Onsite plan, or has used this month’s credits (exports only).

Media typeapplication/json
object
error
required
object
code
required

What went wrong, as a stable word your code can check.

string
Allowed values: invalid_input unauthenticated forbidden not_found payment_required credits_exhausted conflict rate_limited quota_limited search_data_unavailable search_data_changed google_access_lost maintenance internal
message
required

What went wrong, in a sentence a person can act on.

string
param

The parameter or body field at fault, when there is one.

string
allowed

The values it accepts, when there is a fixed set.

Array<string>
didYouMean

The closest allowed value, when the one sent looks like a typo.

string
requestId
required

Quote it to support to find this request.

string

Example

{
"error": {
"code": "invalid_input",
"message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.",
"param": "range",
"didYouMean": "last_28d",
"requestId": "E-7K2Q-M4XD"
}
}

The key can’t do this: it is limited to other sites, it can only read, or its owner’s role doesn’t allow it.

Media typeapplication/json
object
error
required
object
code
required

What went wrong, as a stable word your code can check.

string
Allowed values: invalid_input unauthenticated forbidden not_found payment_required credits_exhausted conflict rate_limited quota_limited search_data_unavailable search_data_changed google_access_lost maintenance internal
message
required

What went wrong, in a sentence a person can act on.

string
param

The parameter or body field at fault, when there is one.

string
allowed

The values it accepts, when there is a fixed set.

Array<string>
didYouMean

The closest allowed value, when the one sent looks like a typo.

string
requestId
required

Quote it to support to find this request.

string

Example

{
"error": {
"code": "invalid_input",
"message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.",
"param": "range",
"didYouMean": "last_28d",
"requestId": "E-7K2Q-M4XD"
}
}

The site, or the thing asked for on it, doesn’t exist or this key can’t read it.

Media typeapplication/json
object
error
required
object
code
required

What went wrong, as a stable word your code can check.

string
Allowed values: invalid_input unauthenticated forbidden not_found payment_required credits_exhausted conflict rate_limited quota_limited search_data_unavailable search_data_changed google_access_lost maintenance internal
message
required

What went wrong, in a sentence a person can act on.

string
param

The parameter or body field at fault, when there is one.

string
allowed

The values it accepts, when there is a fixed set.

Array<string>
didYouMean

The closest allowed value, when the one sent looks like a typo.

string
requestId
required

Quote it to support to find this request.

string

Example

{
"error": {
"code": "invalid_input",
"message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.",
"param": "range",
"didYouMean": "last_28d",
"requestId": "E-7K2Q-M4XD"
}
}

Too many requests for this key. Wait for the Retry-After header’s seconds.

Media typeapplication/json
object
error
required
object
code
required

What went wrong, as a stable word your code can check.

string
Allowed values: invalid_input unauthenticated forbidden not_found payment_required credits_exhausted conflict rate_limited quota_limited search_data_unavailable search_data_changed google_access_lost maintenance internal
message
required

What went wrong, in a sentence a person can act on.

string
param

The parameter or body field at fault, when there is one.

string
allowed

The values it accepts, when there is a fixed set.

Array<string>
didYouMean

The closest allowed value, when the one sent looks like a typo.

string
requestId
required

Quote it to support to find this request.

string

Example

{
"error": {
"code": "invalid_input",
"message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.",
"param": "range",
"didYouMean": "last_28d",
"requestId": "E-7K2Q-M4XD"
}
}

Onsite is down for maintenance, or new data arrived while reading. Try again after the Retry-After header’s seconds.

Media typeapplication/json
object
error
required
object
code
required

What went wrong, as a stable word your code can check.

string
Allowed values: invalid_input unauthenticated forbidden not_found payment_required credits_exhausted conflict rate_limited quota_limited search_data_unavailable search_data_changed google_access_lost maintenance internal
message
required

What went wrong, in a sentence a person can act on.

string
param

The parameter or body field at fault, when there is one.

string
allowed

The values it accepts, when there is a fixed set.

Array<string>
didYouMean

The closest allowed value, when the one sent looks like a typo.

string
requestId
required

Quote it to support to find this request.

string

Example

{
"error": {
"code": "invalid_input",
"message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.",
"param": "range",
"didYouMean": "last_28d",
"requestId": "E-7K2Q-M4XD"
}
}