API guides
Common tasks from the first request to the last, with the errors each one meets.
The examples read the key from $WW_API_KEY; Get started shows how to create one. Every request follows the shared rules for rate limits, pagination, errors and retries.
Find upcoming events in a field
List the seminars, conferences and workshops coming up in one field, then read the details of one.
- 1
List the fields and take the
slugof yours. Neuroscience isneuro.curl --fail-with-body "https://world-wide.org/api/v1/fields" -H "Authorization: Bearer $WW_API_KEY" - 2
Search without
qto list everything under the filters, soonest first. Each entry initemshas anidsuch asconference:019b….curl --fail-with-body --get "https://world-wide.org/api/v1/search" \ -d "field=neuro" -d "type=seminar,conference,workshop" -d "when=upcoming" -d "limit=50" \ -H "Authorization: Bearer $WW_API_KEY" - 3
While
hasMoreis true, ask for the nextpage. The first 1,000 rows can be paged; for more, split the period withfromandtoand page each part.curl --fail-with-body --get "https://world-wide.org/api/v1/search" \ -d "field=neuro" -d "type=seminar,conference,workshop" -d "when=upcoming" -d "limit=50" -d "page=2" \ -H "Authorization: Bearer $WW_API_KEY" - 4
Pass an
idto Get an item for its description, links, topics and type-specificmetadata.curl --fail-with-body "https://world-wide.org/api/v1/items/conference:019b891c-b981-74dc-8f5c-87b1e1ec2c91" -H "Authorization: Bearer $WW_API_KEY"
If it fails
- An empty
itemswithpartialnull means nothing matched. Ifpartialis set, the types inpartial.missingTypescould not be read in time: repeat the request later. 400names the filter it refused, for example a jobs-only filter with event types, orfromtogether withq.503 SEARCH_UNAVAILABLE: wait the 5 seconds inRetry-Afterand repeat.
Keep a copy of open funding calls
Read every open funding call in a field into your own store and refresh it on a schedule.
- 1
List the fields with ids. The listings by type filter by the field's
id, not its slug.curl --fail-with-body "https://world-wide.org/api/v1/domains?includeCounts=false" -H "Authorization: Bearer $WW_API_KEY" - 2
List funding with that id as
domainIdandopenOnly=true, 100 a page. Increasepagewhilepagination.hasNextis true.curl --fail-with-body "https://world-wide.org/api/v1/grants?domainId=019b891c-b981-74dc-8f5c-87b1e1ec2c1e&openOnly=true&limit=100&page=1" -H "Authorization: Bearer $WW_API_KEY" - 3
Key each row by
contentTypeandidtogether. Ajobrow is a job listed under funding. Listings can move between pages during a scan or leave the selected field. Deduplicate by that key and recheck a missing call before changing its status. - 4
To recheck particular rows between runs, get up to 32 items by id as
<contentType>:<id>. A missing id means the API could not return a public item for it. Use the listing or its source to confirm closure.curl --fail-with-body --get "https://world-wide.org/api/v1/items" \ --data-urlencode "ids=grant:019b891c-b981-74dc-8f5c-87b1e1ec2c71,job:019b891c-b981-74dc-8f5c-87b1e1ec2c61" \ -H "Authorization: Bearer $WW_API_KEY"
The whole sync in Python, with paging, keying and retries:
import os
import time
import requests
BASE = "https://world-wide.org/api/v1"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['WW_API_KEY']}"
def get(path, **params):
"""GET one page, waiting out rate limits and brief outages."""
for attempt in range(5):
try:
response = session.get(f"{BASE}{path}", params=params, timeout=30)
except (requests.ConnectionError, requests.Timeout):
if attempt == 4:
raise
time.sleep(2**attempt)
continue
if response.status_code in (429, 503) or response.status_code >= 500:
wait = int(response.headers.get("Retry-After", 2**attempt))
if attempt == 4 or wait > 300: # stop when the server asks for a longer wait
break
time.sleep(wait)
continue
break
response.raise_for_status()
return response.json()
fields = get("/domains", includeCounts="false")["data"]
neuro = next(field for field in fields if field["slug"] == "neuro")
calls, page = {}, 1
while True:
body = get("/grants", domainId=neuro["id"], openOnly="true", limit=100, page=page)
for call in body["data"]:
calls[f"{call['contentType']}:{call['id']}"] = call
if not body["pagination"]["hasNext"]:
break
page += 1
print(len(calls), "open funding calls in", neuro["name"])
If it fails
429: waitRetry-Afterseconds. From one server, 50 requests a minute is the ceiling, so pages of 100 read 5,000 rows a minute.500,502,503,504or a dropped connection: repeat the same page; every read is safe to repeat.400onpage:(page - 1) × limitmay not exceed 100,000.
Read a conference programme
Find a conference, then read its sessions as JSON or as a calendar file, and its ePosters with their files.
- 1
List conferences in a field and take the
conference_idof one. Itsevent_idis a different id that no conference route accepts.curl --fail-with-body "https://world-wide.org/api/v1/conferences?domainSlug=neuro&limit=20" -H "Authorization: Bearer $WW_API_KEY" - 2
Get the conference to check it is public:
404here means the remaining steps would return nothing.curl --fail-with-body "https://world-wide.org/api/v1/conferences/019b891c-b981-74dc-8f5c-87b1e1ec2c91" -H "Authorization: Bearer $WW_API_KEY" - 3
List the programme by start time, 100 sessions a page. Request the next page while a page holds 100 sessions.
curl --fail-with-body "https://world-wide.org/api/v1/conferences/019b891c-b981-74dc-8f5c-87b1e1ec2c91/sessions?limit=100&page=1" -H "Authorization: Bearer $WW_API_KEY" - 4
Or save each page as iCalendar for a calendar app. Fetch it from your server with the key; the file is not a subscription link.
curl --fail-with-body "https://world-wide.org/api/v1/conferences/019b891c-b981-74dc-8f5c-87b1e1ec2c91/sessions?limit=100&format=ics" \ -H "Authorization: Bearer $WW_API_KEY" --output programme.ics - 5
List its ePosters with
include=filesfor each poster's public files.curl --fail-with-body "https://world-wide.org/api/v1/conferences/019b891c-b981-74dc-8f5c-87b1e1ec2c91/eposters?include=files&limit=100" -H "Authorization: Bearer $WW_API_KEY"
If it fails
404from the conference or its programme: the id is anevent_id, a slug or a conference that is not public.- The ePosters route answers
200with an empty list for any id, so check the conference first. - The same conference is
conference:<conference_id>in the catalogue routes, such as Get an item and List a conference's sessions.
Search by meaning
Turn a research question into a topic, rank the catalogue by meaning and topic links, and read the results in one batch.
- 1
Resolve the topic by name. Each node's
idistopic:<slug>.curl --fail-with-body -X POST "https://world-wide.org/api/v1/discovery/graph" -H "Authorization: Bearer $WW_API_KEY" -H "Content-Type: application/json" \ -d '{"operation":"resolve","kind":"topic","query":"working memory","limit":3}' - 2
Send the slug after
topic:(working-memory) intopicsto Scientific discovery search, with the question asquery.hybridranks by words, meaning and topic links;facetscounts every match by type before paging. For the next page, send the same body withpageone higher whilehasMoreis true.curl --fail-with-body -X POST "https://world-wide.org/api/v1/discovery/search" -H "Authorization: Bearer $WW_API_KEY" -H "Content-Type: application/json" \ -d '{"query":"How does sleep support working memory?","mode":"hybrid","topics":["working-memory"],"types":["seminar","podcast"],"facets":["types"],"limit":10}' - 3
Read up to 32 results at once with
batch.requestssays for each id whether it was found and which id it resolved to.curl --fail-with-body -X POST "https://world-wide.org/api/v1/discovery/collections" -H "Authorization: Bearer $WW_API_KEY" -H "Content-Type: application/json" \ -d '{"operation":"batch","ids":["seminar:019b891c-b981-74dc-8f5c-87b1e1ec2c21","podcast:019b891c-b981-74dc-8f5c-87b1e1ec2f01"]}'
If it fails
- Check
partialandcoveragebefore quoting counts: if the query could not be embedded, an automatic search answers with keyword matches and setspartial. 422withsimilarToandmode: "semantic": that item has no embedding; usehybrid.503 SEARCH_UNAVAILABLE: back off and retry, or sendmode: "lexical".
Export records in bulk
Load one type of record into a spreadsheet or database, up to 1,000 rows a request.
- 1
Edit the integration in Settings → API keys and tick Bulk data export.
- 2
Request the data export with an exact field slug as
domain. Add 1,000 tooffsetfor each next file, and stop when a file holds fewer than 1,000 rows. As JSON, stop whenhas_moreis false.curl --fail-with-body "https://world-wide.org/api/data/output?type=jobs&domain=neuro&format=csv&limit=1000&offset=0" \ -H "Authorization: Bearer $WW_API_KEY" --output jobs-0.csv
If it fails
403: the key lacks Bulk data export.domainmust be the exact slug:neurosciencereturns no rows whereneuroreturns them.400onoffset: an export reaches 100,000 rows into a type; split it by field.