FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Sanity Has a Free API — Here's How to Use GROQ to Query Your Content
How-ToWeb Development

Sanity Has a Free API — Here's How to Use GROQ to Query Your Content

via Dev.to WebdevAlex Spinov2h ago

Sanity is a structured content platform with a powerful query language called GROQ. The free tier includes generous API usage — 500K API requests/month and 20GB bandwidth. Setting Up npm create sanity@latest -- --project-id your-id --dataset production Get your project ID and dataset from manage.sanity.io . Querying with GROQ GROQ (Graph-Relational Object Queries) is Sanity's query language — more powerful than REST, simpler than GraphQL. import { createClient } from " @sanity/client " ; const client = createClient ({ projectId : " your-project-id " , dataset : " production " , apiVersion : " 2024-01-01 " , useCdn : true }); // Get all blog posts, ordered by date const posts = await client . fetch ( `*[_type == "post"] | order(publishedAt desc) { title, slug, publishedAt, "authorName": author->name, "categories": categories[]->title, "imageUrl": mainImage.asset->url }` ); posts . forEach ( p => console . log ( ` ${ p . title } by ${ p . authorName } ` )); Advanced GROQ Queries // Count

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
0 views

Related Articles

How-To

10 Things Every Software Developer Should Know (But Most Ignore)

Medium Programming • 48m ago

The Deceptively Tricky Art of Designing a Steering Wheel
How-To

The Deceptively Tricky Art of Designing a Steering Wheel

Wired • 1h ago

7 Wireshark Filters That Instantly Make You Look Like a Network Expert
How-To

7 Wireshark Filters That Instantly Make You Look Like a Network Expert

Medium Programming • 2h ago

Week 6 — No New Problems. Just Me and Everything I Already Learned.
How-To

Week 6 — No New Problems. Just Me and Everything I Already Learned.

Medium Programming • 7h ago

What OpenClaw Gets Wrong Out of the Box (And How to Fix It)
How-To

What OpenClaw Gets Wrong Out of the Box (And How to Fix It)

Medium Programming • 8h ago

Discover More Articles