Wix Code APIs empower you to take full control of your site’s functionality. Use the APIs to interact with page elements, your site’s database content, and external services. The APIs also give you access to information about your site, its users, and more.
The following APIs are available:$w
This API contains everything you need in order to work with your site's components. It allows you to select elements on your site’s pages and interact with them. Each element type exposes properties and functions that you use to enhance the functionality of your site. The $w API can be used in your site’s front-end code.wix-data
This API is used for working with your site’s database collections. It gives you direct access to your collections, allowing you to perform any data operations for querying and editing collection content. You can also add hooks that run code before or after certain interactions with your site’s collections, whether or not those interactions were initiated by the wix-data API. The wix-data API can be used in your site’s front-end or backend code.wix-dataset
This API is used for working with your site’s database collections through a dataset. A dataset is an invisible page element that serves as an intermediary between a page’s elements and the data in a collection. The wix-dataset API can be used in your site’s front-end code.wix-fetch
This API is used to create an API for your site that exposes its functionality as a service. That means other people can use the functionality of your site by writing code that calls your site's API. The wix-http-functions API can be used in your site’s backend code in the http-functions.js file.wix-location
This API is used for getting information about the URL of the current page and for navigating to other pages. The wix-location API can be used in your site’s front-end code.wix-router
This API is used for creating routers and adding hooks to data binding routers. A router allows you to take complete control of handling incoming requests to your site that have a specific prefix in their URLs. You create a router in the Editor and use the functions and objects of this API to define its behavior. You can also add hooks to intercept the process of the data getting bound to your dynamic pages and insert additional logic. The wix-router API can be used in your site’s backend code in the routers.js file.wix-site
This API is used for getting information about your site’s structure. The wix-site API can be used in your site’s front-end code.wix-storage
This API is used for the persistent storage of key/value data in the user's browser. You can store local data that never expires or session data that is available while the user’s web session is still active. The wix-storage API can be used in your site’s front-end code.wix-users
This API is used for working with your site’s registered users. You can get information about the current user, prompt a user to log in, and log out the current user. The wix-users API can be used in your site’s front-end code.wix-window
This API is used for working with the current user’s window. You can get information such as whether the user is on a mobile browser, the size of the browser window, and the locale of the user’s environment. You can also perform actions like opening lightboxes and scrolling the page. The wix-window API can be used in your site’s front-end code.