# New $w() API: Wix Events

**URL:** <https://forum.wixstudio.com/t/new-w-api-wix-events/35453>\
**Category:** Be in the know\
**Tags:** news, code\
**Created:** [September 20, 2022, 4:00pm UTC](https://forum.wixstudio.com/t/new-w-api-wix-events/35453 "2022-09-20T16:00:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamfri](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adamfri/32/31163_2.png) [@adamfri](https://forum.wixstudio.com/u/adamfri)\
**Post date:** [September 20, 2022, 4:00pm UTC](https://forum.wixstudio.com/t/new-w-api-wix-events/35453/1 "2022-09-20T16:00:39Z")

</div>

You can use the [Wix Events](https://www.wix.com/velo/reference/$w/wixevents) element to display events on site pages. The element can be set to display a specific set of events or all the events in an [event category](https://support.wix.com/en/article/wix-events-creating-and-managing-event-categories) .

The new API allows you to access the element in your code. Use the [categoryId](https://www.wix.com/velo/reference/$w/wixevents/categoryid) property to dynamically change which event category to display.

---

<div class="post-metadata">

**Author:** ![webmaster65794](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/webmaster65794/32/37107_2.png) [@webmaster65794](https://forum.wixstudio.com/u/webmaster65794)\
**Post date:** [March 13, 2024, 2:44am UTC](https://forum.wixstudio.com/t/new-w-api-wix-events/35453/2 "2024-03-13T02:44:17Z")

</div>

When setting the categoryId the category indeed changes but now shows past and future events instead of only future ones.
