How to populate inputs on a Sanity site via external API

3 replies
Last updated: Feb 8, 2021

Is it possible to populate input options from an external API? The use case is that we have artworks stored on our own server, and would like to feature certain ones to show on our website’s homepage.

Feb 8, 2021, 2:58 PM

Hi Lawrence, this is indeed possible but may require some work. If you don't mind setting up a custom input component, this should allow you to basically make a call to the external API and populate your options from the response: https://www.sanity.io/docs/custom-input-widgets
Please let me know if you need an assist along the way.

Feb 8, 2021, 3:05 PM

Hi Lawrence, this is indeed possible but may require some work. If you don't mind setting up a custom input component, this should allow you to basically make a call to the external API and populate your options from the response: https://www.sanity.io/docs/custom-input-widgets
Please let me know if you need an assist along the way.

Feb 8, 2021, 3:05 PM

That’s super, thank you. The additional work is no problem at all — just wanted to get a sense of whether it’s possible

Feb 8, 2021, 3:12 PM

Sanity.io: Get the most out of your content

Sanity.io is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Give your team exactly what they need to edit and publish their content with the customizable Sanity Studio. Get real-time collaboration out of the box. Sanity.io comes with a hosted datastore for JSON documents, query languages like GROQ and GraphQL, CDNs, on-demand asset transformations, presentation agnostic rich text, plugins, and much more.

Don't compromise on developer experience. Join thousands of developers and trusted companies and power your content with Sanity.io. Free to get started, pay-as-you-go on all plans.