API

KeywordWeb ScrapingAPIAttributionGlossary TermsPost RequestRoyceObject Entity TypesPagination PurposesRequests

The API may be used to display content in your own site or app provided that you include proper attribution for the content and the hosting site. This can easily be done by displaying the suggested citation for the book or chapter.

POST and GET

You may use either POST or GET requests. A POST request is prioritized, but if it is not provided, then the GET request will be interpreted as a POST.

Data Structure

The API uses three main data object entity types: Author, Book, Chapter, and Keyword. Other objects are also sometimes used, such as glossary terms.

Endpoints

There are two main endpoints for accessing content: search and get_entity.

Search

The search endpoint allows you to retrieve a list of objects that match a keyword term.

https://edtechbooks.org/api.v2.php?action=search

Variables

VariableTypeStatusDefaultDescription
termstringrequired-Specify a url-encoded search term or phrase.
entity_typestringrequired-Specify the entity type.
limitintegeroptional10Specify a limit. Maximum: 200
offsetintegeroptional0Specify an offset for pagination purposes.
api_keystringoptional-Some functions require an API key, while others do not.

Examples

Return all books that match the term "technology:"

https://edtechbooks.org/api.v2.php?action=search&entity_type=Book&term=technology

Return all authors with the name "Royce:" 

https://edtechbooks.org/api.v2.php?action=search&entity_type=Author&term=Royce

Get Entity

The get_entity endpoint allows you to retrieve a structured object for the entity.

https://edtechbooks.org/api.v2.php?action=get_entity

Variables

VariableTypeStatusDefaultDescription
termstringrequired-Specify a url-encoded search term or phrase.
entity_typestringrequired-Specify the entity type.
idintegerrequired-Specify the unique identifier of the entity.
keystringoptional-Some functions require an API key, while others do not.

Examples

Return the book with the identifier 3:

https://edtechbooks.org/api.v2.php?action=get_entity&entity_type=Book&entity_id=3

Return a chapter with the identifier 155:

https://edtechbooks.org/api.v2.php?action=get_entity&entity_type=Chapter&entity_id=155

Get a glossary term either from its unique identifier or a text string.

https://edtechbooks.org/api.v2.php?action=get_entity&entity_type=GlossaryTerm&entity_id=Behaviorism

Push Check

The push_check endpoint allows you to test if your API key is working for future calls. Note that an API key is required, which may be found in your user settings.

https://edtechbooks.org/api.v2.php?action=push_check&api_key=YOURAPIKEYHERE

Variables

VariableTypeStatusDefaultDescription
keystringrequired-Pushing data requires an API key.

Authentication anad API Keys

You can create an ETB API key for your project by logging in and going to the Developer dashboard in the top-right menu. This requires developer access, which you can request by contacting a site administrator.

This content is provided to you freely by Ensign College.

Access it online or download it at https://ensign.edtechbooks.org/userguide/reading_api.