About Published Site URLs

The Published Site URLs API allows you to retrieve links to a published site, including the site's primary and secondary URLs, and their language info.

On occasion, you might want to direct a Wix user to the published site - for example, to the site's homepage in a secondary language. With this API, you can easily access the URLs to their published site.

Use cases

Terminology

  • Published site: A Wix site that is live and visible to site visitors.
  • Premium: Wix users can pay for Premium plans to unlock additional site tools and features, including connecting their own domains. Read more about Premium plans.
  • Primary URL: Wix users can connect an unlimited number of domains (URLs) to a single Wix site. The primary URL is the domain that they connect directly to the site and is the site's main URL.
  • Secondary URL: When Wix users connect additional domains/URLs to a site, they are considered secondary URLs, and will redirect visitors to the primary URL.
  • Wix Multilingual: A Wix product that manages site translation. Read more about Wix Multilingual.
Did this help?

Sample flows

This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation.

Direct Wix users to their published site

You might choose to direct Wix users from within your app to the published site. To do this:

  1. Include a call to action that redirects to the relevant URL - for example, a button.
  2. When the Wix user clicks the button, call the List Published Site URLs method.
  3. Redirect the site builder to the relevant URL as provided in the response.
Did this help?

Published Site Urls Object


The Published Site URLs object provides a list of URLs for the published site.

Properties
urlsArray <Url>maxItems 1000

List of published site URLs. This array will be empty if the site isn't published.

Did this help?

GET

List Published Site Urls


Retrieves a list of a site's published URLs. If a site hasn't been published, the call returns an empty array.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Read Site URLs
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/urls-server/v2/published-site-urls

Query Params
filters.urlTypestring

URL type filter. Default: ALL


filters.primaryboolean

Whether to return only the site's primary URL.
Default: true.


filters.multilingualboolean

Whether to return language subdomains hosted by Wix Multilingual.
Default: true.

Response Object
urlsArray <Url>maxItems 1000

List of published site URLs. This array will be empty if the site isn't published.

List Published Site URLs
Request
cURL
curl -X GET \ 'https://www.wixapis.com/urls-server/v2/published-site-urls' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \
Response
JSON
{ urls: [ "urlType" : "Premium", "primary" : true, "url": "https://www.your-domain.com", "multilingualInfo": { "languageCode": "en", "defaultLanguage": true } ]
Errors
400Invalid Argument

There are 3 errors with this status code:

See the entire list and learn more about Wix errors.

Did this help?