> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # GetQuota # Package: seo # Namespace: SeoKeywordsSuggestionsSPI # Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/seo/seo-keywords-suggestions-service-plugin/get-quota.md ## Introduction This method requests information about remaining quota in the plan. A Wix user can purchase a paid plan from your site or utilize a free plan if you offer one. You provide information about the current plan including how many searches remain out of the total in the plan, the dates of the plan, and whether the user currently has a paid plan. Wix calls this method when a Wix user opens the SEO page of the Dashboard. --- ## REST API ### Schema ``` Method: getQuota Description: This method requests information about remaining quota in the plan. A Wix user can purchase a paid plan from your site or utilize a free plan if you offer one. You provide information about the current plan including how many searches remain out of the total in the plan, the dates of the plan, and whether the user currently has a paid plan. Wix calls this method when a Wix user opens the SEO page of the Dashboard. URL: null Method: POST Return type: GetQuotaResponse - name: quota | type: Quota | description: *Required if `quotaEnabled` is `true` in the configuration**. Information about remaining credit in the plan. - name: remaining | type: integer | description: *Required**. Number of searches left until the end of the current quota cycle. - name: limit | type: integer | description: *Required**. Total number of searches available in the current quota cycle. - name: startDate | type: string | description: *Required**. Start date and time of the current quota cycle as UTC datetime in `YYYY-MM-DDThh:mm[:ss][.sss]Z` format. - name: endDate | type: string | description: *Required**. End date and time of the current quota cycle as UTC datetime in `YYYY-MM-DDThh:mm[:ss][.sss]Z` format. After this time, the quota is reset - name: paidPlan | type: boolean | description: *Required**. Whether the user currently has a paid plan. If `false`, the user is offered an upgrade using the `upgradeUrl` from the configuration. Possible Errors: HTTP Code: 401 | Status Code: UNAUTHENTICATED | Application Code: MISSING_TOKEN | Description: none HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: QUOTA_LIMIT_REACHED | Description: none ``` ### Examples ### Get quota ```curl curl POST https://www.provider.example.com/v1/get-quota \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.seo.SeoKeywordsSuggestionsSPI.getQuota(metadata) Description: This method requests information about remaining quota in the plan. A Wix user can purchase a paid plan from your site or utilize a free plan if you offer one. You provide information about the current plan including how many searches remain out of the total in the plan, the dates of the plan, and whether the user currently has a paid plan. Wix calls this method when a Wix user opens the SEO page of the Dashboard. Method parameters: param name: metadata | type: Context | description: this message is not directly used by any service, it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. e.g. SPIs, event-handlers, etc.. NOTE: this context object MUST be provided as the last argument in each Velo method signature. Example: ```typescript export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { ... } ``` - name: requestId | type: string | description: A unique identifier of the request. You may print this GUID to your logs to help with future debugging and easier correlation with Wix's logs. - name: currency | type: string | description: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. - name: identity | type: IdentificationData | description: An object that describes the identity that triggered this request. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: languages | type: array | description: A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. - name: instanceId | type: string | description: The service provider app's instance GUID. Return type: PROMISE - name: quota | type: Quota | description: *Required if `quotaEnabled` is `true` in the configuration**. Information about remaining credit in the plan. - name: remaining | type: integer | description: *Required**. Number of searches left until the end of the current quota cycle. - name: limit | type: integer | description: *Required**. Total number of searches available in the current quota cycle. - name: startDate | type: Date | description: *Required**. Start date and time of the current quota cycle as UTC datetime in `YYYY-MM-DDThh:mm[:ss][.sss]Z` format. - name: endDate | type: Date | description: *Required**. End date and time of the current quota cycle as UTC datetime in `YYYY-MM-DDThh:mm[:ss][.sss]Z` format. After this time, the quota is reset - name: paidPlan | type: boolean | description: *Required**. Whether the user currently has a paid plan. If `false`, the user is offered an upgrade using the `upgradeUrl` from the configuration. Possible Errors: HTTP Code: 401 | Status Code: UNAUTHENTICATED | Application Code: MISSING_TOKEN | Description: none HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: QUOTA_LIMIT_REACHED | Description: none ``` ### Examples ### Example of a `quota` return value @description: ```javascript import { seoKeywordSuggestions } from "@wix/marketing/service-plugins"; seoKeywordSuggestions.provideHandlers({ getQuota: async (payload) => { const { request, metadata } = payload; // Use the `request` and `metadata` received from Wix and // apply custom logic. return { // Return your response exactly as documented to integrate with Wix. // Return value example: quota: { endDate: "2024-07-05T07:04:35Z", limit: 10, paidPlan: false, remaining: 9, startDate: "2024-07-04T07:04:35Z", }, }; }, }); ``` ### getQuota (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { seoKeywordSuggestions } from '@wix/marketing/service-plugins'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { seoKeywordSuggestions }, // Include the auth strategy and host as relevant }); async function getQuota(metadata) { const response = await myWixClient.seoKeywordSuggestions.getQuota(metadata); }; ``` ---