By the fastCRW team · Catalogue figures checked 2026-11-05 against GET /v1/data · Verify independently before relying on any figure.
An agent that answers questions about people, places or companies needs two things: a stable identifier for the entity, and a source it can quote. Wikidata gives you the identifier and structured claims. Wikipedia gives you the summary and the reading traffic. Pergamon, the public data catalogue behind fastCRW, exposes both through one API key, and every response carries its licence and attribution. This guide shows the calls that work on 2026-11-05 and where they stop.
Search an entity
Start with wikidata/search. It takes the name to look up in search and a language code in language. The first hit for "Ada Lovelace" in English was the item Q7259 on 2026-11-05, described as an English mathematician. The second hit was Q114068528, described as "GPU microarchitecture designed by Nvidia". The candidates are in data.search, each with id, label and description. Keep the Q-id of the one you pick. Every later call uses it, so the agent does not have to match names again.
curl "https://api.fastcrw.com/v1/data/wikidata/search?search=Ada%20Lovelace&language=en" \
-H "Authorization: Bearer $CRW_API_KEY"
That second hit is the point: names are not unique. Show the candidate list to the user, or pick by a second signal such as the description, before you trust the first hit.
Read the claims for an entity
Once you have the Q-id, wikidata/claims returns the statements Wikidata holds about it. Pass property to read one property only. P569 is Wikidata's date of birth property, so this call reads Ada Lovelace's date of birth as Wikidata states it. On 2026-11-05 the statement held a time value of +1815-12-10T00:00:00Z at day precision, with its own references:
curl "https://api.fastcrw.com/v1/data/wikidata/claims?entity=Q7259&property=P569" \
-H "Authorization: Bearer $CRW_API_KEY"
Cite the statement, not the item label. A claim is what a contributor recorded, with its own sources and rank, and the agent should keep the property id next to the value so a reader can check it on wikidata.org.
Run SPARQL with a small LIMIT
The sparql capability runs a SPARQL query against the Wikidata Query Service. Use the Python SDK for it, because a SPARQL query is full of spaces, braces and quotes that are awkward in a URL. Send the query on one line: on 2026-11-05 the same query written over several lines was refused with a 400 and the message Parameter "query" is not valid. This query lists people who received the Nobel Prize in Physics, using the specific prize item Q38104, with English labels. It returned 10 rows:
# pip install crw
from crw import CrwClient
client = CrwClient() # reads CRW_API_KEY
query = (
"SELECT ?person ?personLabel WHERE { "
"?person wdt:P31 wd:Q5 ; wdt:P166 wd:Q38104 . "
"SERVICE wikibase:label { bd:serviceParam wikibase:language 'en'. } "
"} LIMIT 10"
)
result = client.get_data("wikidata", "sparql", {"query": query})
print(result["provenance"]["attributionText"])
for row in result["data"]["results"]["bindings"]:
print(row["person"]["value"], row["personLabel"]["value"])
The first lines of output were:
Source: Wikidata (CC0)
http://www.wikidata.org/entity/Q133846 George Paget Thomson
http://www.wikidata.org/entity/Q134085 Jean-Baptiste Perrin
http://www.wikidata.org/entity/Q148109 Subrahmanyan Chandrasekhar
One of the 10 rows came back with the Q-id (Q151746) as its label, because that item has no English label. Handle that case before you show labels to a user. Pick the prize item carefully, too. On 2026-11-05, the same pattern with the generic "Nobel Prize" item, Q7191, returned 0 rows, so use the specific prize item. Keep LIMIT small while you test, because a large result is a large response for your agent to read.
Wikipedia summary and pageviews
The wikipedia provider gives you the summary of an article by its title. Titles use underscores in place of spaces. In the Python SDK, the summary is one call, with the same client as above:
summary = client.get_data("wikipedia", "summary", {"title": "Ada_Lovelace"})
print(summary["provenance"]["attributionText"]) # Source: Wikipedia, CC BY-SA 4.0
print(summary["data"]["wikibase_item"], summary["data"]["extract"][:80])
The summary carries the article text in extract and the matching Wikidata item in wikibase_item, which was Q7259 for this title. That field is the bridge from a Wikipedia title to a Q-id, so you can skip the name search when you start from an article.
Pageviews need a project, an article and a date range. The dates use the YYYYMMDD form, not dashes. This call asked for daily views of the English article for 1 to 7 October 2026:
curl "https://api.fastcrw.com/v1/data/wikipedia/pageviews?project=en.wikipedia&article=Ada_Lovelace&start=20261001&end=20261007" \
-H "Authorization: Bearer $CRW_API_KEY"
The response lists one entry per day under data.items, each with timestamp, agent and views. The first day, 1 October 2026, showed 4,171 views from the user agent. Pageviews are a traffic count for the range you pass, not a count of readers.
Putting it together in an agent
A working agent runs the calls in a fixed order. It searches for the name and picks one candidate, reads the claims for that Q-id, then fetches the Wikipedia summary for the matching article title. Pageviews come last and only when the question is about attention. Each step keeps its own citation, so the final answer can point to a Wikidata statement, a Wikipedia summary and a traffic count separately.
Keep the Q-id and the article title as your join keys, and do not re-search by name after the first step. If a step returns nothing, say which step came back empty instead of filling the gap with a guess.
Link to other sources
Many Wikidata items carry an external-identifier property, such as an ORCID iD for a researcher. Read those claims with wikidata/claims, then pass the identifier to the source that owns it. For example, an identifier that points to a company or a musician lets your agent move from a general encyclopedia entry to the registry or catalogue record. Some of those sources are client-run. A client-run source, such as MusicBrainz, needs the local server on the machine that runs your agent. See the MusicBrainz guide for the setup.
Licence and attribution
The two providers have different licences, so read each response and quote it:
- Wikidata: the licence line in the catalogue reads "released into the public domain under CC0 1.0". CC0 means no attribution is required, but keep the attribution text anyway so your reader can trace the source.
- Wikipedia: the licence line reads "Article text is CC BY-SA 4.0 and GFDL; reuse requires attribution and share-alike on derivatives of the text." If your agent republishes article text, you must attribute it and share the derivative under the same terms.
Read provenance.licence and provenance.attributionText on each response. In the SDK these are camelCase keys, and in the REST response they are snake_case.
Honest limits
- Wikidata is edited by its community, so a claim can be wrong or out of date. Show the property and the value, and let the reader check the item.
- SPARQL can be slow or time out on broad queries. Add filters and a small
LIMITbefore you widen one. Each SPARQL call is one call, billed like any other call, and a failed call is not billed. - A name search returns candidates, not the one right entity. Disambiguate before you act on a match.
- The Wikipedia summary is a short extract. Read the article itself for anything beyond the lead.
- Pageview counts are traffic, not a measure of importance or accuracy.
Sources
- Wikidata data access
- Wikidata Query Service
- Wikipedia REST API
- Wikimedia pageviews API
- CC0 1.0 and CC BY-SA 4.0
Related: Wikidata on Pergamon · Wikipedia on Pergamon · MusicBrainz and Discogs from your own machine · Build a knowledge graph from web data · Public data API for AI agents · Pergamon catalogue
