Shadertoy API

As of today, Shadertoy's API is open to all of you, let's get creative! Any developer can build apps (or webs) and access Shadertoys that have the right privacy settings ("Public + API").

Request Your Key

Sign In and come back to this page for instructions

What Can You Access?

After you request your API Key, you will be able to access your (and others') beloved Shadertoys from any website/app. This basically means that you can run queries on our database, and even download shaders to use them on your own software (check licenses).

If you can not see your shader listed in the API make sure the privacy of your shader is set to "Public + API", be aware that when you do that other users will be able to access/use your shaders.

Coding: Simple, Very Simple

All API calls require a key that you can request (check the first section of this page) for free and returns JSON files that you can easily read with your favorite parser.

Here are the basics of our API:

  • Query shaders: as a developer you can pass any query to run on our database. This service will return an array of IDs.

    https://www.shadertoy.com/api/v1/shaders/query/string?key=appkey

    where string is your search string such as tags, usernames, words...


  • Get a shader from a shader ID.

    https://www.shadertoy.com/api/v1/shaders/shaderID?key=appkey

    where shaderID is the same ID used in the Shadertoy URLs, and also the values returned by the "Query Shaders".


  • Access the assets.

    When you retrieve a shader you will see a key called "inputs", this can be a texture/video/keyboard/sound used by the shader. The JSON returned when accessing a shader will look like this:

    [..]{"inputs":[{"id":17,"src":"/presets/tex12.png","ctype":"texture","channel":0}[..]

    To access this specific asset you can just cut and paste this path https://www.shadertoy.com/presets/tex12.png


  • Get all shaders.

    https://www.shadertoy.com/api/v1/shaders?key=appkey

Advanced queries:

  • Query shaders sorted by "name", "love", "popular", "newest", "hot" (by default, it uses "popular").

    https://www.shadertoy.com/api/v1/shaders/query/string?sort=newest&key=appkey


  • Query shaders with paging. Define a "from" and a "num" of shaders that you want (by default, there is no paging)

    https://www.shadertoy.com/api/v1/shaders/query/string?from=5&num=25&key=appkey


  • Query shaders with filters: "vr", "soundoutput", "soundinput", "webcam", "multipass", "musicstream" (by default, there is no filter)

    https://www.shadertoy.com/api/v1/shaders/query/string?filter=vr&key=appkey



Source Code

Official Shadertoy App - Check our Github!

License

"Shadertoy.com API" is free and open. Shadertoy.com is not responsible for either the malfuntioning of the API or the malfunctioning of any of the shaders return by the API.

Since the API is part of Shadertoy.com, developers that use the API have to respect the terms of use. For example, developers must respect the specific licenses of each shader.

Any product (app, web...) that uses the "Shadertoy.com API", either free or commercial, must mention that uses "Shadertoy.com API".