Python 2 Software Development Kit
Note: This version of the SDK is no longer receiving updates. Updating to the Python 3 SDK is recommended.
Requirements
- Python 2.7.x
- IEEE Xplore API Access Key
Methods Overview
Note: Parameters are usually strings so they should have quotes around them.
Query Methods
Method | Parameter(s) | Usage |
---|---|---|
abstractText() |
One parameter: the abstract text | Queries text in abstracts. |
affiliationText() |
One parameter: the affiliation text | Queries text in affiliation data field. |
articleNumber() |
One parameter: article number | Creates a query using IEEE’s unique article identifier. Note: when used all other query methods are ignored. |
articleTitle() |
One parameter: article title | Queries based on the title of an individual document. Can be used with other query methods, except for articleNumber() . |
authorFacetText() |
One parameter: author facet text | Queries text in Open Author Facet data field. |
authorText() |
One parameter: author text | Queries text in author data field. |
booleanText() |
One parameter: boolean query | Creates a boolean query against all configured metadata fields, abstract, and document text. Do not include parentheses. |
contentTypeFacetText() |
One parameter: content type facet text | Queries text in Open Content Type Facet data field. |
doi() |
One parameter: digital object identifier | Creates a query using IEEE’s unique digital object identifier. Note: when used all other query methods are ignored, except for articleNumber() , which overrides the digital object identifier. |
facetText() |
One parameter: facet text | Queries text in Open/Facet data field. |
indexTerms() |
One parameter: index terms text | Queries text in Author Keywords, IEEE Terms, and Mesh Terms. Note: include no more than two wildcard words. Each wildcard word must have a minimum of three characters preceding the wildcard (*). |
isbn() |
One parameter: isbn number | Queries based on International Standard Book Number. |
issn() |
One parameter: issn number | Queries based on International Standard Serial Number. |
issueNumber() |
One parameter: issue number | Queries based on Journal Issue Number. |
metaDataText() |
One parameter: meta data text | Queries text in configured metadata fields and abstracts. Note: include no more than two wildcard words. Each wildcard word must have a minimum of three characters preceding the wildcard (*). |
openAccess() |
One parameter: article number | Queries article based on its article number and returns the full text for that article, if the article is Open Access. When this method is used the only output returned is the article. |
publicationFacetText() |
One parameter: publication facet text | Queries text in Open Publication Facet data field. |
publisherFacetText() |
One parameter: publisher facet text | Queries text in Open Publisher’s Facet data field. |
publicationTitle() |
One parameter: publication title text | Queries text in the title of a publication (Journal, Conferences, or Standard). |
publicationYear() |
One parameter: publication year | Queries against the publication year data field. Note: the format of this data varies by publication. |
queryText() |
One parameter: text to query | Queries against all configured metadata fields, abstract, and document text. Note: include no more than two wildcard words. Each wildcard word must have a minimum of three characters preceding the wildcard (*). |
searchField() |
Two parameters are passed. The first parameter is the name of the data field being queried or the type of query; accepted values are: "abstract" The second parameter is the value to query in that data field. |
Serves as a general-purpose query builder, as it is not tied to a particular data field. Also used for Boolean queries against all configured metadata fields, abstract, and document text, if ‘boolean_text’ is passed for the first parameter and the Boolean query is passed as the second parameter (omit parentheses in value). |
thesaurusTerms() |
One parameter: thesaurus terms (IEEE terms) text | Queries keywords assigned to IEEE journal articles and conference papers from a controlled vocabulary created by the IEEE. Note: include no more than two wildcard words. Each wildcard word must have a minimum of three characters preceding the wildcard (*). |
Filter and Sort Methods
Method | Parameter(s) | Usage |
---|---|---|
startingResult() |
One parameter: result position (a number) | Sets the starting position in the set of results (for example, starting at the third result). |
maximumResults() |
One parameter: maximum number of results to return | Sets the maximum size of the result set returned. Defaults to 25 and has a max of 200. |
resultsFilter() |
Two parameters are passed. The first parameter is the filter type; accepted values are: "content_type" "end_year" "open_access" "publication_number" "publisher" "start_year" The second parameter is the value used for the filtering. |
Reduces the result set based on the parameter matching the value passed. Multiple filters can be in place, but only one filter per type (for example, only one end_year filter can be used for filtering). See the Filtering Parameters for the accepted values. |
resultsSorting() |
One or two parameters are passed. The first parameter is the data field being used for sorting; accepted values are: "author" "article_number" "article_title" "publication_title" "publication_year" The second parameter is optional and sets the sort order (if omitted the value is "asc"). Values accepted are: "asc" "desc" |
Sets the field used for sorting and the direction of the sorting. |
Results Methods
Method | Parameter(s) | Usage |
---|---|---|
dataType() |
One parameter is passed for the data type; the accepted values are:"json" "xml" |
Sets the data type for the results; defaults to JSON. |
dataFormat() |
One parameter is passed for the data structure; the accepted values are:"raw" "object" |
Sets the data structure for the result."raw" is the unmodified data string from the API."object" returns a JSON object or ElementTree object, depending on the data type specified. |
Running the Query and Getting Results
Method | Parameter(s) | Usage |
---|---|---|
callAPI() |
There is an optional debugging parameter – pass False to this method to enter that mode | This is called after one or more Query Methods are specified. If debugging mode is enabled (by passing False), then the complete query that would be sent to the API is returned. Otherwise the data or an error message is returned. |
Defaults
- Data type defaults to JSON.
- Data format defaults to raw (the unmodified data string from the API).
- Position 1 in the set of results is the starting position.
- Results sort by Article Title and in ascending order (A-Z) by default; if the Content Type is set to ‘Standards’ then sorting is by Publication Year because Standards do not have some of the other sorting fields.
- Maximum number of results returned defaults to 25.
Examples
Italicized text in the examples below should be replaced with your desired values.
Query by Abstract Text
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.abstractText('query') data = query.callAPI()
Query by Affiliation
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.affiliationText('query') data = query.callAPI()
Query by Article Number
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.articleNumber('article_number') data = query.callAPI()
Query by Article Title
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.articleTitle('query') data = query.callAPI()
Query by Author Facet
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.authorFacetText('query') data = query.callAPI()
Query by Author Name
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.authorText('query') data = query.callAPI()
Boolean Query
Searches all configured metadata fields, abstract, and document text.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.booleanText('boolean_query_without_parentheses') data = query.callAPI()
Query by Open Content Type Facet
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.contentTypeFacetText('query') data = query.callAPI()
Query by DOI (Digital Object Identifier)
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.doi(‘doi’) data = query.callAPI()
Query by Open/Facet Value
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.facetText(‘query’) data = query.callAPI()
Query by Index Terms
Queries text in Author Keywords, IEEE Terms, and Mesh Terms.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.indexTerms(‘terms’) data = query.callAPI()
Query by ISBN
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.isbn(‘isbn’) data = query.callAPI()
Query by ISSN
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.issn(‘issn’) data = query.callAPI()
Query by Issue Number
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.issueNumber(‘issue_number’) data = query.callAPI()
Query by Meta Data
Queries text in configured metadata fields and abstracts.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.metaDataText(‘query’) data = query.callAPI()
Query for Open Access Article
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.openAccess(‘article number’) data = query.callAPI()
Query by Publication Facet
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.publicationFacetText('query') data = query.callAPI()
Query by Publisher Facet
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.publisherFacetText('query') data = query.callAPI()
Query by Publication Title
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.publicationTitle('query') data = query.callAPI()
Query by Publication Year
Note: Depending on publication the format of the year may vary.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.publicationYear(‘year’) data = query.callAPI()
Query by Meta Data, Abstract, or Document Text
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') data = query.callAPI()
Query by Thesaurus Terms
Note: Thesaurus Terms are also called IEEE Terms.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.thesaurusTerms(‘terms’) data = query.callAPI()
Query by Specific Data Field
This is a general-purpose method that accepts two parameters - the first is the field(s) to search, the second is the query.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.searchField(‘datafield’, ‘query’) data = query.callAPI()
Query Involving Multiple Data Fields
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') query.publicationYear(‘year’) data = query.callAPI()
Query Involving a Wildcard
Note: include no more than two wildcard words. Each wildcard word must have a minimum of three characters preceding the wildcard (*).
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText(‘query*’) data = query.callAPI()
Query Involving Multiple Data Fields
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') query.publicationYear(‘year’) data = query.callAPI()
Query Involving Filtering and Sorting of Results
Note: resultsFilter() can be called more than once, as long as a different data field is specified as its first parameter.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') query.startingResult(‘result_number’) query.maximumResults(‘result_maximum_number’) query.resultsFilter(‘data_field_name’,’filter_by_text’) query.resultsSorting(‘data_field_name’,’sort_asc_or_desc’) data = query.callAPI()
Query with XML String as Data Output
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') query.dataType(‘xml’) query.dataFormat(‘raw’) data = query.callAPI()
Query with ElementTree Object as Data Output
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') query.dataType(‘xml’) query.dataFormat(‘object’) data = query.callAPI()
Query with JSON String as Data Output
Note: Data type defaults to JSON.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') query.dataType(‘json’) query.dataFormat(‘raw’) data = query.callAPI()
Query with JSON Object as Data Output
Note: Data type defaults to JSON.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') query.dataType(‘json’) query.dataFormat(‘object’) data = query.callAPI()
Query with Debugging Enabled
Note: The query URL that would be sent to the API is output; no call is made to the API.
import xplore query = xplore.xploreapi.XPLORE('api_access_key') query.queryText('query') data = query.callAPI(False)
Error Messages
Message Text | Trigger |
---|---|
"Searches against field <fieldname> are not supported" | Passing an invalid field name as the first parameter to the searchField() method. |
No search criteria provided | No query methods were used. |
Wildcard word {word} has fewer than 3 valid characters (only for search). Wildcard words (word*) must have at least three characters preceding *. | Wildcard character (*) used in words with too few characters. |
Query contains more than 2 wildcard words (only for search). | Wildcard character (*) used too often in a query. |
Service Not Found | API error; returns HTTP Status Code 500. |
Internal Server Error | API error; returns HTTP Status Code 596 or HTTP Status Code 500. |