### Installation Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Install the Scopus API library using Composer. ```APIDOC ## Installation ### Description Install the Scopus API library using Composer. ### Command ```bash composer require hbll-collection-development/scopus-api ``` ``` -------------------------------- ### Install Scopus API Client Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Install the Scopus API client using Composer. This command fetches and installs the necessary package for your project. ```bash composer require hbll-collection-development/scopus-api ``` -------------------------------- ### start($start) Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/affiliation-retrieval.md Sets the starting position for paginated results. ```APIDOC ## start($start) ### Description Set the starting position for pagination. ### Parameters - **$start** (int) - Required - Zero-indexed start position. ### Returns `$this` for method chaining. ``` -------------------------------- ### Set Pagination Start Position Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/affiliation-search.md Use the `start` method to define the starting position for paginating results. This is a zero-indexed position. ```php public function start(int $start): self ``` -------------------------------- ### startref($startref) Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/abstract-retrieval.md Sets the starting position for reference retrieval in the abstract data. ```APIDOC ## Method `startref($startref)` ### Description Set the starting position for reference retrieval. ### Parameters #### Path Parameters - **$startref** (int) - Required - Starting index for references ### Returns `$this` for method chaining ``` -------------------------------- ### Execute Search and Get Citations Overview Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/citations-overview.md Executes the retrieval request to get citation overview data. The response format can be JSON or XML. This method is used after setting necessary parameters like scopus_id, count, and start. ```php public function search(): string ``` ```php $citationsOverview = new \Scopus\CitationsOverview('your-api-key'); $results = $citationsOverview ->scopus_id('85028623301') ->count(10) ->start(0) ->search(); $data = json_decode($results, true); foreach ($data['abstracts-retrieval-response']['citation-overview'] as $citation) { echo $citation['dc:title'] . "\n"; } ``` -------------------------------- ### Method Documentation Details Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/MANIFEST.md Detailed documentation is provided for each method, including signatures, parameters, return types, errors, and examples. ```APIDOC ## Method Documentation Each method in the Scopus API is documented with: - **Full Signature**: Includes parameter types. - **Parameter Table**: Details name, type, required status, default value, and description for each parameter. - **Return Type**: Specifies the return type and its meaning. - **Throws/Error Conditions**: Lists potential exceptions and their triggers. - **Usage Example**: Demonstrates how to use the method. - **Method Chaining**: Support for chaining methods is indicated where applicable. ``` -------------------------------- ### Set Pagination Start Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/author-search.md Specify the zero-indexed starting position for paginating results. This method supports chaining. ```php $authorSearch->start(50); ``` -------------------------------- ### Basic Usage Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Example of how to search for affiliations and parse the results. ```APIDOC ## Basic Usage ### Description Example of how to search for affiliations and parse the results. ### Code Example ```php require_once 'vendor/autoload.php'; // Search for affiliations $affiliationSearch = new \Scopus\AffiliationSearch('your-api-key'); $results = $affiliationSearch ->query('AFFIL(MIT)') ->count(25) ->search(); // Parse results $data = json_decode($results, true); echo $data['search-results']['opensearch:totalResults']; ``` ``` -------------------------------- ### Install Scopus API PHP SDK via Composer Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md Use Composer to install the Scopus API PHP SDK. Add this to your project's dependencies. ```json "require": { "hbll-collection-development/scopus-api": "^1.0" } ``` -------------------------------- ### Method Chaining Example Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/scopus-base.md Demonstrates fluid API patterns by chaining multiple method calls. All methods return `$this` to enable this. ```php $results = $search ->query('TITLE(Machine Learning)') ->count(10) ->start(0) ->sort('+citedby-count') ->httpAccept('application/json') ->search(); ``` -------------------------------- ### Set Reference Retrieval Start Position Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/scopus-base.md Specify the starting index for retrieving reference lists. This is useful when dealing with large sets of references. ```php public function startref(int $startref): self ``` -------------------------------- ### Set Starting Position for Pagination Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/scopus-search.md Determine the starting point for paginating search results. This parameter uses zero-based indexing. ```php $scopusSearch->start(50); ``` -------------------------------- ### Abstract Retrieval JSON Response Example Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md An example of the JSON response structure for an abstract retrieval request. ```json { "abstracts-retrieval-response": { "coredata": { "prism:url": "https://api.elsevier.com/content/abstract/scopus_id/85028623301", "dc:identifier": "SCOPUS_ID:85028623301", "link": [ { "@href": "https://api.elsevier.com/content/abstract/scopus_id/85028623301", "@rel": "self", "@_fa": "true" } ] } } } ``` -------------------------------- ### Date Format Examples Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/types.md Illustrates the supported date formats for filtering, including specific dates, years, and date ranges. ```text YYYY-MM-DD # Specific date YYYY # Specific year [YYYY-MM-DD TO YYYY-MM-DD] # Date range ``` -------------------------------- ### Retrieve Abstract by Specific Scopus ID Example Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md A concrete example of initializing AbstractRetrieval with a specific Scopus ID '85028623301' to retrieve its abstract. ```php $abstractRetrieval = new \Scopus\AbstractRetrieval('85028623301', 'scopusId', 'API-KEY'); ``` -------------------------------- ### Scopus Search JSON Response Example Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md An example of the JSON response structure returned by a Scopus search query. ```json { "search-results": { "opensearch:totalResults": "432", "opensearch:startIndex": "0", "opensearch:itemsPerPage": "1", "opensearch:Query": { "@role": "request", "@searchTerms": "TITLE(Tragedy of the Commons)", "@startPage": "0" }, "link": [ { "@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/search/scopus?start=0&count=1&query=TITLE%28Tragedy+of+the+Commons%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json" }, { "@_fa": "true", "@ref": "first", "@href": "https://api.elsevier.com/content/search/scopus?start=0&count=1&query=TITLE%28Tragedy+of+the+Commons%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json" }, { "@_fa": "true", "@ref": "next", "@href": "https://api.elsevier.com/content/search/scopus?start=1&count=1&query=TITLE%28Tragedy+of+the+Commons%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json" }, { "@_fa": "true", "@ref": "last", "@href": "https://api.elsevier.com/content/search/scopus?start=431&count=1&query=TITLE%28Tragedy+of+the+Commons%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json" } ], "entry": [ { "@_fa": "true", "link": [ { "@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/abstract/scopus_id/85028623301" }, { "@_fa": "true", "@ref": "author-affiliation", "@href": "https://api.elsevier.com/content/abstract/scopus_id/85028623301?field=author,affiliation" }, { "@_fa": "true", "@ref": "scopus", "@href": "https://www.scopus.com/inward/record.uri?partnerID=HzOxMe3b&scp=85028623301&origin=inward" }, { "@_fa": "true", "@ref": "scopus-citedby", "@href": "https://www.scopus.com/inward/citedby.uri?partnerID=HzOxMe3b&scp=85028623301&origin=inward" } ], "prism:url": "https://api.elsevier.com/content/abstract/scopus_id/85028623301", "dc:identifier": "SCOPUS_ID:85028623301", "eid": "2-s2.0-85028623301", "dc:title": "An allometric tragedy of the commons: Response to the article “Evaluation of models capacity to predict size spectra parameters in ecosystems under stress”", "dc:creator": "Mulder C.", "prism:publicationName": "Ecological Indicators", "prism:issn": "1470160X", "prism:volume": "84", "prism:pageRange": "161-164", "prism:coverDate": "2018-01-01", "prism:coverDisplayDate": "January 2018", "prism:doi": "10.1016/j.ecolind.2017.08.042", "pii": "S1470160X17305320", "citedby-count": "0", "affiliation": [ { "@_fa": "true", "affilname": "National Institute of Public Health and the Environment", "affiliation-city": "Bilthoven", "affiliation-country": "Netherlands" } ], "prism:aggregationType": "Journal", "subtype": "le", "subtypeDescription": "Letter", "source-id": "20292" } ] } } ``` -------------------------------- ### Set Start Position Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/serial-title.md Sets the starting position for paginated results. This is a zero-indexed value. ```APIDOC ## start($start) ### Description Set the starting position for pagination. ### Method ```php public function start(int $start): self ``` ### Parameters #### Path Parameters - **$start** (int) - Required - Zero-indexed start position ### Returns `$this` for method chaining ``` -------------------------------- ### Configuring Scopus Search via Method Chaining Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/configuration.md Illustrates the fluent API pattern for configuring a Scopus search query, including query parameters, count, start, sort order, and view/field options. ```php $results = (new \Scopus\ScopusSearch('your-api-key')) ->query('TITLE(Machine Learning)') ->count(25) ->start(0) ->sort('+citedby-count') ->httpAccept('application/json') ->view('STANDARD') ->field('all') ->search(); ``` -------------------------------- ### Example: Search for Serial Title Metadata Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/serial-title.md Demonstrates how to instantiate the SerialTitle class, set an ISSN, specify fields to retrieve, execute a search, and parse the JSON response to access the serial title. ```php $serialTitle = new \Scopus\SerialTitle('your-api-key'); $results = $serialTitle ->issn('1470-160X') ->field('all') ->search(); $data = json_decode($results, true); echo $data['serial-metadata-response']['entry'][0]['dc:title']; ``` -------------------------------- ### Execute Search and Get Results Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/author-search.md Executes the configured search request. The response format (JSON or XML) depends on the httpAccept setting. Throws a RequestException on HTTP failure. ```php public function search(): string ``` ```php $results = $authorSearch->search(); $data = json_decode($results, true); echo $data['search-results']['opensearch:totalResults']; ``` -------------------------------- ### Parser API Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/MANIFEST.md Documentation for the Parser class, covering key normalization, extension examples, and recursive parsing behavior. ```APIDOC ## Parser API Reference ### Description Reference for the Parser class, documenting key normalization, providing extension examples, and explaining its recursive parsing behavior. ### Functionality - Key normalization. - Recursive parsing. ### Examples - Extension examples for the parser. ``` -------------------------------- ### Nested JSON Normalization Example Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/parser.md Illustrates the recursive key normalization applied to nested JSON structures, including attributes and namespaced keys. ```json // Original Scopus JSON { "search-results": { "opensearch:totalResults": "432", "link": [ { "@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/..." } ] } } // After parsing and normalization: [ "search_results" => [ "opensearch_totalResults" => "432", "link" => [ [ "fa" => "true", "ref" => "self", "href" => "https://api.elsevier.com/..." ] ] ] ] ``` -------------------------------- ### Citations Overview Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Get an overview of citations for abstracts. ```APIDOC ## GET https://api.elsevier.com/content/abstract/citations ### Description Get citations overview. ### Method GET ### Endpoint https://api.elsevier.com/content/abstract/citations ``` -------------------------------- ### CitationsOverview Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Get citing articles overview using the CitationsOverview API client. ```APIDOC ## CitationsOverview ### Description Get citing articles overview. ### Method GET ### Endpoint /v2/citation-overview ### Parameters #### Query Parameters - **eid** (string) - Required - The EID (Electronic Identifier) of the document. ### Request Example ```json { "eid": "2-s2.0-12345678901" } ``` ### Response #### Success Response (200) - **citing_articles_count** (string) - The number of articles that cite this document. #### Response Example ```json { "citing_articles_count": "100" } ``` ``` -------------------------------- ### Author Search API Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/MANIFEST.md Documentation for the AuthorSearch class, including co_author() method and method chaining examples. ```APIDOC ## Author Search API Reference ### Description Full reference for the AuthorSearch class, including documentation for the `co_author()` method and examples of method chaining. ### Methods - `co_author()` - Method chaining examples. ### Parameters - Documented within the respective method details. ### Return Types - Documented within the respective method details. ### Examples - Method chaining examples provided. ``` -------------------------------- ### Basic Affiliation Search Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Perform a basic search for affiliations using the Scopus API. This example demonstrates initializing the search, setting a query, specifying the count, and executing the search. ```php require_once 'vendor/autoload.php'; // Search for affiliations $affiliationSearch = new \Scopus\AffiliationSearch('your-api-key'); $results = $affiliationSearch ->query('AFFIL(MIT)') ->count(25) ->search(); // Parse results $data = json_decode($results, true); echo $data['search-results']['opensearch:totalResults']; ``` -------------------------------- ### Example JSON Response for Author Search Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md This is a sample JSON response structure for an author search query. It includes details about the search results, query parameters, and individual author entries. ```json { "search-results": { "opensearch:totalResults": "1", "opensearch:startIndex": "0", "opensearch:itemsPerPage": "1", "opensearch:Query": { "@role": "request", "@searchTerms": "AUTHLASTNAME(Howland) AND AUTHFIRST(J) AND AF-ID(60006832)", "@startPage": "0" }, "link": [ { "@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/search/author?start=0&count=25&query=AUTHLASTNAME%28Howland%29+AND+AUTHFIRST%28J%29+AND+AF-ID%2860006832%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json" }, { "@_fa": "true", "@ref": "first", "@href": "https://api.elsevier.com/content/search/author?start=0&count=25&query=AUTHLASTNAME%28Howland%29+AND+AUTHFIRST%28J%29+AND+AF-ID%2860006832%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json" } ], "entry": [ { "@_fa": "true", "link": [ { "@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/author/author_id/14071559700" }, { "@_fa": "true", "@ref": "search", "@href": "https://api.elsevier.com/content/search/author?query=au-id%2814071559700%29" }, { "@_fa": "true", "@ref": "scopus-citedby", "@href": "https://www.scopus.com/author/citedby.uri?partnerID=HzOxMe3b&citedAuthorId=14071559700&origin=inward" }, { "@_fa": "true", "@ref": "scopus-author", "@href": "https://www.scopus.com/authid/detail.uri?partnerID=HzOxMe3b&authorId=14071559700&origin=inward" } ], "prism:url": "https://api.elsevier.com/content/author/author_id/14071559700", "dc:identifier": "AUTHOR_ID:14071559700", "eid": "9-s2.0-14071559700", "preferred-name": { "surname": "Howland", "given-name": "Jared L.", "initials": "J.L." }, "name-variant": [ { "@_fa": "true", "surname": "Howland", "given-name": "Jared", "initials": "J." } ], "document-count": "4", "subject-area": [ { "@abbrev": "SOCI", "@frequency": "4", "$": "Social Sciences (all)" }, { "@abbrev": "COMP", "@frequency": "1", "$": "Computer Science (all)" } ], "affiliation-current": { "affiliation-url": "https://api.elsevier.com/content/affiliation/affiliation_id/60006832", "affiliation-id": "60006832", "affiliation-name": "Brigham Young University", "affiliation-city": "Provo", "affiliation-country": "United States" } } ] } } ``` -------------------------------- ### Execute Search and Get Results Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/scopus-search.md Executes the search request and returns the results as a JSON or XML string. This method is crucial for retrieving search data. ```php public function search(): string ``` ```php $results = $scopusSearch->search(); $data = json_decode($results, true); echo $data['search-results']['opensearch:totalResults']; foreach ($data['search-results']['entry'] as $entry) { echo $entry['dc:title'] . "\n"; } ``` -------------------------------- ### Execute Search and Get Results Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/serial-title.md Executes the retrieval request based on the configured parameters and returns the response as a JSON or XML string. Ensure that the HTTP accept header is correctly set prior to calling this method. This method can throw a GuzzleHttp\Exception\RequestException if the HTTP request fails. ```php public function search(): string ``` -------------------------------- ### Configuration Reference Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/MANIFEST.md Documentation for constructor parameters, query parameter methods, validation rules, and HTTP client configuration. ```APIDOC ## Configuration Reference ### Description Documents constructor parameters, all 40+ query parameter methods, parameter validation rules, and HTTP client configuration. ### Parameters - Constructor parameters. - 40+ query parameter methods. - Parameter validation rules. ### Validation - ISSN validation details. - ID type validation. ### Configuration - HTTP client configuration. - Environment variable guidance. ### Examples - Parameter validation examples. ``` -------------------------------- ### Instantiate SubjectClassifications Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/subject-classifications.md Initialize the SubjectClassifications client for either 'scopus' or 'scidir' systems. Ensure your API key is provided. ```php require_once 'vendor/autoload.php'; $subjectClassifications = new Scopus\SubjectClassifications('scopus', 'your-api-key'); $results = $subjectClassifications ->code('1402') ->search(); ``` -------------------------------- ### Instantiate CitationsOverview Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/citations-overview.md Initialize the CitationsOverview class with your Scopus API key and an optional timeout. The API key is required for authentication. ```php require_once 'vendor/autoload.php'; $citationsOverview = new Scopus\CitationsOverview('your-api-key'); $results = $citationsOverview ->scopus_id('85028623301') ->count(25) ->search(); ``` -------------------------------- ### Instantiate Custom Parser Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/parser.md Demonstrates how to instantiate a custom parser with a JSON response and retrieve normalized data. Requires a custom class extending Parser. ```php $jsonResponse = '{"search-results": {"opensearch:totalResults": "100"}}'; $parser = new CustomParser($jsonResponse); $data = $parser->retrieve(); // Result: ["search_results" => ["opensearch_totalResults" => "100"]] ``` -------------------------------- ### Constructor Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/scopus-search.md Initializes a new instance of the ScopusSearch class. Requires an API key for authentication and allows setting an optional timeout. ```APIDOC ## Constructor Initializes a new instance of the ScopusSearch class. ### Parameters - **$apiKey** (string) - Required - Scopus API key for authentication - **$timeout** (float) - Optional - HTTP request timeout in seconds (default: 30.0) ### Returns `ScopusSearch` instance ### Throws `Exception` if apiKey is empty or not provided ### Example ```php require_once 'vendor/autoload.php'; $scopusSearch = new \Scopus\ScopusSearch('your-api-key'); $results = $scopusSearch ->query('TITLE(Artificial Intelligence)') ->count(25) ->search(); ``` ``` -------------------------------- ### Configuration Documentation Details Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/MANIFEST.md Guidance on configuring the Scopus API client, including authentication, timeouts, and parameter handling. ```APIDOC ## Configuration Documentation Configuration options include: - **Constructor Parameters**: Settings available during client initialization. - **Query Parameter Methods**: Over 40 methods for configuring query parameters. - **Parameter Validation Rules**: Rules governing parameter values. - **HTTP Client Configuration**: Settings for the underlying HTTP client. - **Timeout Configuration**: Setting request timeouts. - **Authentication Options**: Details on authentication methods. - **Response Format Configuration**: Options for response formats. - **Method Chaining Pattern**: Explanation of the method chaining approach. ``` -------------------------------- ### Instantiate AuthorSearch Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/author-search.md Initialize the AuthorSearch client with your Scopus API key. The timeout parameter is optional. ```php require_once 'vendor/autoload.php'; $authorSearch = new \Scopus\AuthorSearch('your-api-key'); $results = $authorSearch ->query('AUTHLASTNAME(Smith) AND AUTHFIRST(John)') ->count(10) ->search(); ``` -------------------------------- ### Abstract Retrieval Initialization Options Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md Demonstrates alternative ways to initialize the AbstractRetrieval client using different identifier types like EID, DOI, PII, PubMed ID, or PUI. ```php $abstractRetrieval = new \Scopus\AbstractRetrieval('EID', 'eid', 'API-KEY'); ``` ```php $abstractRetrieval = new \Scopus\AbstractRetrieval('DOI', 'doi', 'API-KEY'); ``` ```php $abstractRetrieval = new \Scopus\AbstractRetrieval('PII', 'pii', 'API-KEY'); ``` ```php $abstractRetrieval = new \Scopus\AbstractRetrieval('PUBMED-ID', 'pubmedId', 'API-KEY'); ``` ```php $abstractRetrieval = new \Scopus\AbstractRetrieval('PUI', 'pui', 'API-KEY'); ``` -------------------------------- ### Citations Count Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Get the citation count for abstracts. ```APIDOC ## GET https://api.elsevier.com/content/abstract/citation-count ### Description Get citation count. ### Method GET ### Endpoint https://api.elsevier.com/content/abstract/citation-count ``` -------------------------------- ### Constructor Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/subject-classifications.md Initializes the SubjectClassifications client. You can specify the classification system ('scidir' or 'scopus'), your API key, and an optional timeout. ```APIDOC ## Constructor ```php new \Scopus\SubjectClassifications($searchType, $apiKey = null, $timeout = null) ``` ### Parameters #### Path Parameters - **$searchType** (string) - Required - Classification system: `scidir` or `scopus` - **$apiKey** (string) - Required - Scopus API key for authentication - **$timeout** (float) - Optional - HTTP request timeout in seconds (default: 30.0) ### Throws - `Exception` if $apiKey is empty - `Exception` if $searchType is not `scidir` or `scopus` ### Example ```php require_once 'vendor/autoload.php'; $subjectClassifications = new \Scopus\SubjectClassifications('scopus', 'your-api-key'); $results = $subjectClassifications ->code('1402') ->search(); ``` ``` -------------------------------- ### Method Chaining Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Demonstrates the fluent API pattern using method chaining for constructing search queries. ```APIDOC ## Method Chaining ### Description All query parameter methods return `$this`, enabling fluent API patterns for constructing search queries. ### Code Example ```php $results = (new \Scopus\ScopusSearch('api-key')) ->query('TITLE(Machine Learning)') ->count(50) ->start(0) ->sort('+citedby-count') ->httpAccept('application/json') ->search(); ``` ``` -------------------------------- ### CitationsCount Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/README.md Get citation counts for documents using the CitationsCount API client. ```APIDOC ## CitationsCount ### Description Get citation counts for documents. ### Method GET ### Endpoint /v2/citation-count ### Parameters #### Query Parameters - **eid** (string) - Required - The EID (Electronic Identifier) of the document. ### Request Example ```json { "eid": "2-s2.0-12345678901" } ``` ### Response #### Success Response (200) - **citation_count** (string) - The total citation count for the document. #### Response Example ```json { "citation_count": "50" } ``` ``` -------------------------------- ### Constructor Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/serial-title.md Initializes a new instance of the SerialTitle class. Requires an API key for authentication and optionally accepts a timeout value. ```APIDOC ## Constructor ```php new \Scopus\SerialTitle($apiKey = null, $timeout = null) ``` ### Parameters #### Path Parameters - **$apiKey** (string) - Required - Scopus API key for authentication - **$timeout** (float) - Optional - HTTP request timeout in seconds (default: 30.0) ### Returns `SerialTitle` instance ### Throws `Exception` if apiKey is empty or not provided ### Example ```php require_once 'vendor/autoload.php'; $serialTitle = new \Scopus\SerialTitle('your-api-key'); $results = $serialTitle ->issn('1234-5678') ->search(); ``` ``` -------------------------------- ### Validators API Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/MANIFEST.md Documentation for the Validator abstract base class, including IssnValidator and IsbnValidator with usage examples. ```APIDOC ## Validators API Reference ### Description Reference for the Validator abstract base class, detailing the IssnValidator (with full algorithm) and IsbnValidator (ISBN-10 and ISBN-13), including usage examples. ### Classes - `Validator` (abstract base class) - `IssnValidator` - `IsbnValidator` ### Functionality - ISSN validation algorithm. - ISBN-10 and ISBN-13 validation. ### Examples - Usage examples for ISSN and ISBN validation. ``` -------------------------------- ### Handle API Key from Environment Variable Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/configuration.md Implement logic to retrieve the API key from environment variables and throw an exception if it's not set. This is useful for application-level configuration. ```php $apiKey = getenv('SCOPUS_API_KEY'); if (!$apiKey) { throw new Exception('SCOPUS_API_KEY environment variable not set'); } $search = new \Scopus\AffiliationSearch($apiKey); ``` -------------------------------- ### Instantiate AuthorRetrieval Class Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/author-retrieval.md Initialize the AuthorRetrieval class with your Scopus API key and an optional timeout. Ensure the API key is provided for authentication. ```php require_once 'vendor/autoload.php'; $authorRetrieval = new Scopus\AuthorRetrieval('your-api-key'); $results = $authorRetrieval ->author_id('14071559700') ->search(); ``` -------------------------------- ### Instantiate ScopusSearch Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/scopus-search.md Create a new instance of the ScopusSearch class. Requires your Scopus API key for authentication. Optionally, you can set an HTTP request timeout. ```php require_once 'vendor/autoload.php'; $scopusSearch = new \Scopus\ScopusSearch('your-api-key'); $results = $scopusSearch ->query('TITLE(Artificial Intelligence)') ->count(25) ->search(); ``` -------------------------------- ### Affiliation Search API Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/MANIFEST.md Documentation for the AffiliationSearch class, including 11 public methods, parameters, return types, and examples. ```APIDOC ## Affiliation Search API Reference ### Description Full reference for the AffiliationSearch class, detailing its public methods, parameters, return types, and usage examples. ### Methods - 11 public methods documented. ### Parameters - Documented within the respective method details. ### Return Types - Documented within the respective method details. ### Examples - Usage examples provided for methods. ``` -------------------------------- ### Perform Author Search Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md Initializes an AuthorSearch client and performs a search query. Ensure you have your API key and the correct query parameters. ```php $authorSearch = new \Scopus\AuthorSearch('API-KEY'); $results = $authorSearch ->query('AUTHLASTNAME(Howland) AND AUTHFIRST(J) AND AF-ID(60006832)') ->search(); ``` -------------------------------- ### Sort Search Results Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/scopus-search.md Order the search results based on a specified field. For example, sort by citation count in descending order using '+citedby-count'. ```php $scopusSearch->sort('+citedby-count'); ``` -------------------------------- ### Set Sort Order Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/author-search.md Sort the search results based on a specified field. For example, '+surname' sorts by surname in ascending order. This method supports chaining. ```php $authorSearch->sort('+affiliation_city'); ``` -------------------------------- ### Instantiate SerialTitle with API Key Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/serial-title.md Initialize the SerialTitle client with your Scopus API key. The timeout parameter can be adjusted for HTTP requests. An exception is thrown if the API key is missing. ```php require_once 'vendor/autoload.php'; $serialTitle = new \Scopus\SerialTitle('your-api-key'); $results = $serialTitle ->issn('1234-5678') ->search(); ``` -------------------------------- ### Validator::make() Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/validators.md Creates a new instance of a validator using the static constructor pattern. This method is intended to be used to get an instance of a concrete validator class. ```APIDOC ## Validator::make() ### Description Create a new instance of the validator using static constructor pattern. ### Method `public static function make(): Validator` ### Returns New instance of the concrete validator class ### Example ```php $validator = \Scopus\Validators\IssnValidator::make(); $isValid = $validator->validate('1234-5678'); ``` ``` -------------------------------- ### Initialize AffiliationSearch Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/affiliation-search.md Instantiate the AffiliationSearch class with your Scopus API key. The timeout parameter is optional and defaults to 30 seconds. ```php require_once 'vendor/autoload.php'; $affiliationSearch = new \Scopus\AffiliationSearch('your-api-key'); $results = $affiliationSearch ->query('AFFIL(Brigham Young University)') ->count(25) ->search(); ``` -------------------------------- ### Instantiate CitationsCount Class Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/citations-count.md Initialize the CitationsCount class with your Scopus API key. The timeout can also be optionally set. ```php require_once 'vendor/autoload.php'; $citationsCount = new \Scopus\CitationsCount('your-api-key'); $results = $citationsCount ->scopus_id('85028623301') ->search(); ``` -------------------------------- ### Using Scopus Parser with SDK Responses Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/parser.md Demonstrates how to manually use the Scopus Parser class with SDK responses. Requires extending the base Parser class for custom logic. ```php require_once 'vendor/autoload.php'; $search = new \Scopus\AffiliationSearch('api-key'); $jsonResponse = $search->query('AFFIL(MIT)')->search(); // Manual parsing would need custom extension // The base Parser class provides key normalization class MyParser extends \Scopus\Parser { } ``` -------------------------------- ### CitationsOverview Constructor Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/citations-overview.md Initializes the CitationsOverview class with an API key and optional timeout. The API key is required for authentication. ```APIDOC ## Constructor ### Description Initializes a new instance of the CitationsOverview class. ### Parameters #### Path Parameters - **$apiKey** (string) - Required - Scopus API key for authentication. - **$timeout** (float) - Optional - HTTP request timeout in seconds. Defaults to 30.0. ### Returns `CitationsOverview` instance ### Throws `Exception` if apiKey is empty or not provided. ### Example ```php require_once 'vendor/autoload.php'; $citationsOverview = new \Scopus\CitationsOverview('your-api-key'); $results = $citationsOverview ->scopus_id('85028623301') ->count(25) ->search(); ``` ``` -------------------------------- ### Scopus API Client Constructor Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/configuration.md Instantiate Scopus API client classes with an API key and an optional timeout. The API key is mandatory for authentication. ```php new \Scopus\AffiliationSearch($apiKey = null, $timeout = null) ``` -------------------------------- ### Scopus Search Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md Allows users to search for articles within the Scopus database using various query parameters. The API returns a list of search results, including total count, start index, and items per page, along with links to the results and individual entries. ```APIDOC ## Scopus Search API ### Description This endpoint allows you to search the Scopus database for articles based on specified criteria. It returns a paginated list of results. ### Method POST (implied by SDK usage, actual HTTP method not specified in source) ### Endpoint Not explicitly defined, but likely related to `https://api.elsevier.com/content/search/scopus` based on documentation link. ### Parameters - **API-KEY**: string - Required - Your API key for authentication. - **Query**: string - Required - The search query string (e.g., 'TITLE(Tragedy of the Commons)'). ### Request Example ```php $scopusSearch = new \Scopus\ScopusSearch('API-KEY'); $results = $scopusSearch->query('TITLE(Tragedy of the Commons)')->search(); ``` ### Response #### Success Response (200) - **search-results**: object - Contains the search results. - **opensearch:totalResults**: string - The total number of results found. - **opensearch:startIndex**: string - The starting index of the current results page. - **opensearch:itemsPerPage**: string - The number of items per page. - **opensearch:Query**: object - Details about the executed query. - **link**: array - Links for pagination and self-reference. - **entry**: array - An array of article entries matching the query. #### Response Example ```json { "search-results": { "opensearch:totalResults": "432", "opensearch:startIndex": "0", "opensearch:itemsPerPage": "1", "opensearch:Query": { "@role": "request", "@searchTerms": "TITLE(Tragedy of the Commons)", "@startPage": "0" }, "link": [ { "@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/search/scopus?start=0&count=1&query=TITLE%28Tragedy+of+the+Commons%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json" } ], "entry": [ { "@_fa": "true", "link": [ { "@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/abstract/scopus_id/85028623301" } ], "prism:url": "https://api.elsevier.com/content/abstract/scopus_id/85028623301", "dc:identifier": "SCOPUS_ID:85028623301", "eid": "2-s2.0-85028623301", "dc:title": "An allometric tragedy of the commons: Response to the article \"Evaluation of models capacity to predict size spectra parameters in ecosystems under stress\"", "dc:creator": "Mulder C.", "prism:publicationName": "Ecological Indicators", "prism:issn": "1470160X", "prism:volume": "84", "prism:pageRange": "161-164", "prism:coverDate": "2018-01-01", "prism:coverDisplayDate": "January 2018", "prism:doi": "10.1016/j.ecolind.2017.08.042", "pii": "S1470160X17305320", "citedby-count": "0", "affiliation": [ { "@_fa": "true", "affilname": "National Institute of Public Health and the Environment", "affiliation-city": "Bilthoven", "affiliation-country": "Netherlands" } ], "prism:aggregationType": "Journal", "subtype": "le", "subtypeDescription": "Letter", "source-id": "20292" } ] } } ``` ``` -------------------------------- ### Basic Scopus API Initialization Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/configuration.md Initialize the AffiliationSearch client with your Scopus API key. You can also specify a custom HTTP request timeout in seconds. ```php require_once 'vendor/autoload.php'; // Using API key $search = new \Scopus\AffiliationSearch('your-scopus-api-key'); $results = $search->query('AFFIL(MIT)')->search(); // With custom timeout (60 seconds) $search = new \Scopus\AffiliationSearch('your-scopus-api-key', 60.0); ``` -------------------------------- ### Handle Missing API Key Exception Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/configuration.md Catch exceptions thrown when the API key is not provided during client initialization. The exception message indicates the requirement for an API key. ```php try { $search = new \Scopus\AffiliationSearch(null); } catch (Exception $e) { echo $e->getMessage(); // "You must set the API Key before making a call." } ``` -------------------------------- ### Customizing HTTP Client Timeout Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/configuration.md Demonstrates how to set a custom timeout value for the SDK client instance. Use this for time-sensitive operations. ```php // 60-second timeout $search = new \Scopus\AffiliationSearch('your-api-key', 60.0); // 5-second timeout for time-sensitive applications $search = new \Scopus\AffiliationSearch('your-api-key', 5.0); ``` -------------------------------- ### Initialize AbstractRetrieval by Scopus ID Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/abstract-retrieval.md Instantiate the AbstractRetrieval class with a Scopus ID, specifying the ID type and API key. Ensure the 'vendor/autoload.php' is included for class loading. ```php require_once 'vendor/autoload.php'; // By Scopus ID $abstractRetrieval = new \Scopus\AbstractRetrieval('85028623301', 'scopusId', 'your-api-key'); $results = $abstractRetrieval->search(); ``` -------------------------------- ### insttoken Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/citations-overview.md Sets an institutional token for authentication. This method is chainable. ```APIDOC ## insttoken($insttoken) ### Description Sets an institutional token for authentication. ### Method ```php public function insttoken(string $insttoken): self ``` ### Parameters #### Path Parameters - **$insttoken** (string) - Yes - Institutional token ### Returns `$this` for method chaining ``` -------------------------------- ### insttoken Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/serial-title.md Sets an institutional token for authentication. This method is chainable. ```APIDOC ## insttoken($insttoken) ### Description Sets an institutional token for authentication. ### Method Set ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```php $serialTitle->insttoken('your-institutional-token'); ``` ### Response #### Success Response Returns `$this` for method chaining. #### Response Example (Method chaining, no direct response body) ``` -------------------------------- ### Set HTTP Accept Header Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/author-retrieval.md Configure the response format by setting the HTTP Accept header using the httpAccept method. Supported formats include 'application/json' and 'application/xml'. ```php $authorRetrieval->httpAccept('application/json'); ``` -------------------------------- ### Catching General Exceptions in PHP Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/errors.md Demonstrates how to catch generic exceptions thrown by the Scopus SDK. This is useful for general error handling when specific error types are not anticipated. ```php try { $search = new \Scopus\AffiliationSearch(null); } catch (Exception $e) { echo $e->getMessage(); echo $e->getCode(); } ``` -------------------------------- ### Default GuzzleHttp Client Configuration Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/configuration.md Shows the default configuration used by the SDK's GuzzleHttp Client, including timeout and headers. These can be overridden. ```php $client = new Client([ 'timeout' => 30.0, // Overridable via $timeout constructor parameter 'headers' => [ 'Accept' => 'application/json', // Overridable via httpAccept() ], ]); ``` -------------------------------- ### AuthorSearch Constructor Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/author-search.md Initializes a new instance of the AuthorSearch class. Requires an API key for authentication and allows setting an optional timeout. ```APIDOC ## Constructor ### Description Initializes a new instance of the AuthorSearch class. Requires an API key for authentication and allows setting an optional timeout. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature `new \Scopus\AuthorSearch($apiKey = null, $timeout = null)` ### Parameters - **$apiKey** (string) - Required - Scopus API key for authentication - **$timeout** (float) - Optional - HTTP request timeout in seconds (default: 30.0) ### Returns `AuthorSearch` instance ### Throws `Exception` if apiKey is empty or not provided ### Example ```php require_once 'vendor/autoload.php'; $authorSearch = new \Scopus\AuthorSearch('your-api-key'); $results = $authorSearch ->query('AUTHLASTNAME(Smith) AND AUTHFIRST(John)') ->count(10) ->search(); ``` ``` -------------------------------- ### search() Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/affiliation-search.md Executes the configured search request and returns the response. ```APIDOC ## search() ### Description Execute the search request and return the response. ### Method Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Returns JSON or XML string (depending on `httpAccept` setting) containing search results ### Throws `GuzzleHttp\Exception\RequestException` if the HTTP request fails ### Example ```php $results = $affiliationSearch->search(); $data = json_decode($results, true); echo $data['search-results']['opensearch:totalResults']; ``` ``` -------------------------------- ### Perform Affiliation Search (JSON) Source: https://github.com/hbll-collection-development/scopus-api/blob/master/README.md Initialize the AffiliationSearch with your API key and perform a search query. Defaults to JSON response. ```php $affiliationSearch = new \Scopus\AffiliationSearch('API-KEY'); $results = $affiliationSearch ->query('AFFIL(Brigham Young University)') ->count(1) ->search(); ``` -------------------------------- ### httpAccept Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/api-reference/citations-overview.md Sets the response format using the HTTP Accept header. ```APIDOC ## httpAccept ### Description Sets the desired response format by specifying the MIME type in the HTTP Accept header. ### Method `httpAccept(string $httpAccept): self` ### Parameters #### Path Parameters - **$httpAccept** (string) - Required - MIME type (e.g., `application/json`, `application/xml`). ### Returns `$this` for method chaining. ``` -------------------------------- ### Handling Missing API Key Exception Source: https://github.com/hbll-collection-development/scopus-api/blob/master/_autodocs/errors.md Catch a specific exception when the API key is not provided to the constructor. Recovery involves providing a valid Scopus API key. ```php try { $search = new \Scopus\AffiliationSearch(null); } catch (Exception $e) { echo "Error: " . $e->getMessage(); // Handle missing API key } ```