Skip to main content



Add a calendar to your page with a small script.


"your-div-id" can be named anything you'd like. Just make sure it matches the variable in your JavaScript.

If you have multiple calendars on your page, you will need unique ids for each one.

<div id="your-div-id"></div>


If you want defaults use:

  calNum: 'a5hq-yx6s', //Socrata database number *Required
  numItems: 4, 
  title: 'Events',
  titleIcon: 'fa-calendar', 
  allItemsUrl: '',
  allItemsText: 'See all events',
  version: 2,
  url: ''

About that URL above

You have a few choices about how to point to your data.

  • In Socrata, you can create an account and then use that to create a filtered view of the master calendar dataset that's at

  • If you are used to SQL, you can use SoQL (Socrata Query Language, documented at This is the most powerful and flexible option.

    • Start with (include the question mark)

    • Filter by whether a category has been checked. For example, if Metro was checked, you'd add metro=true, so the URL would be

    • String together multiple filter items by using an ampersand. For example, if you only want things categorized as Elections that are displayed on the county home page, the URL would be

    • Pay someone else to do this for you. Email your request and budget number and we will put together the URL for you.


    We encourage everyone to use the King County master calendar, and then use a filtered view or a special query to display your own calendar items.

    If you are creating your own calendar dataset to work with this script, instead, certain field names and field types are required for it to work.

    • Start time, a time/date field (not with timezone).
    • End time, a time/date field (not with timezone).
    • Event name
    • Location name
    • URL, a Web URL field type
    • If you want a map, include separate address, city, state, and zip fields from which to build a location field

    More information on working with Socrata can be found at in several places: