Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

How to Export Dataset in a JSON File

6 replies
Last updated: Aug 15, 2022
Hi guys.I want to export all of my dataset in Json file.
can someone tell me how can I do that?
Aug 14, 2022, 3:41 PM
Have you check the data export docs: https://www.sanity.io/docs/export ? šŸ™‚
Aug 14, 2022, 4:20 PM
You can also use the CLI by following step 1 of the Export, reshape, import instructions in the Migrating Data docs.
Aug 14, 2022, 4:23 PM
user F
yes I check that and wrote this:
curl https://<projectId>.<http://api.sanity.io/v2021-06-07/data/export/<dataset>/|api.sanity.io/v2021-06-07/data/export/<dataset>/> > backup.ndjson
but this text give me the first data of the dataset and I want the hole data of the dataset
šŸ™‚
Aug 14, 2022, 6:22 PM
user A
Umm. I didn't get what you said sorryšŸ˜…can you explain it more?
Aug 14, 2022, 6:23 PM
Sure. If you follow the link, it provides a command you can run in your terminal, which will export the dataset you specify to a destination file.
Aug 14, 2022, 6:28 PM
user A
Thank you so much. I will check that and if there is any question I'll come back againšŸ˜…šŸ™
Aug 15, 2022, 6:39 AM

Sanityā€“ build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?