Lesson 10 / 25
Structured Data with JSON-LD
Describe your organisation, products and FAQs in machine-readable schema.org markup.
Say it in a machine-friendly way
Structured data labels the facts on a page so software can read them without guessing. The common format is JSON-LD using the schema.org vocabulary: types such as Organization, Product, SoftwareApplication, Article, FAQPage and LocalBusiness. Include your name, URL, logo, description and sameAs links to your official profiles, which helps connect your site to the same entity elsewhere. Structured data must match visible page content and be valid. It aids understanding, but nobody can promise it will change what an assistant says, so treat it as good hygiene, not magic.
Organization markup, run
I ran this: it builds the JSON-LD, parses it back and checks that the required keys exist. Place the output inside a <script type="application/ld+json"> tag in the page head.
import json
org = {"@context": "https://schema.org", "@type": "Organization",
"name": "Acme Tasks", "url": "https://acme.example",
"sameAs": ["https://www.linkedin.com/company/acme-tasks",
"https://github.com/acme-tasks"]}
back = json.loads(json.dumps(org, indent=2))
required = ["@context", "@type", "name", "url"]
print([k for k in required if k not in back], back["@type"], len(back["sameAs"]))
Output:
[] Organization 2
Validate before publishing
Test markup with a structured-data validator (such as the Schema Markup Validator) and keep it in sync with the page. Marking up facts that are not visible, or false facts, can be treated as spam.
Quick check: What should structured data always do?
- Match the visible content of the page
- Contain hidden claims
- Replace the page text
- Be as long as possible
Answer
Match the visible content of the page — Markup is a label on real content, so it must agree with what users and crawlers can read.