---
title: "Publish each page's data as a file · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/ready-for-ai-agents/structured-data-for-agents
updated: 2026-10-20
licence: "All rights reserved"
---

# Publish each page's data as a file

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Ready for AI agents](https://agentwranglers.se/playbook/website/ready-for-ai-agents)
- Rule: Publish each page's JSON-LD (structured facts) in the page and as its own file. Then agents can read the facts without parsing HTML.
- How: Write each page's JSON-LD graph to a file at build time. Serve it at `/page.jsonld` with `application/ld+json`. Link it with `<link rel="alternate" type="application/ld+json">`.
- Check: A test parses the embedded graph and the file for every page. They are identical, and both pass a validator such as validator.schema.org.

Example:

```html
<link rel="alternate" type="application/ld+json" href="/services.jsonld">
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"Service","name":"Roof repair","provider":{"@type":"Organization","name":"Example Co","url":"https://example.com/"}}
</script>
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/ready-for-ai-agents/structured-data-for-agents`.

- Previous: [Explain how agents sign up](https://agentwranglers.se/playbook/website/ready-for-ai-agents/auth-md)
- Next: [Offer content machines can read](https://agentwranglers.se/playbook/website/ready-for-ai-agents/machine-readable-formats)
- [Ready for AI agents](https://agentwranglers.se/playbook/website/ready-for-ai-agents)
