Unofficial PHP HTTP client to access Stocksnap's API
Stocksnap-PHP
uses Composer. To use it, require the library
composer require diza/stocksnap
Retrieve a list of photos.
Note: You need to instantiate an httpclient object first
Arguments
Argument | Type | Opt/Required | Note |
---|---|---|---|
$order_by |
string | Opt (Default: date) | Accepted values: date , trending , views , downloads , favorites |
$sort_order |
string | Opt (Default: desc) | Accepted values: asc , desc |
$page |
int | Opt (Default: 1) |
Example
$stocksnap = new Diza\Stocksnap\HttpClient();
$photos = $stocksnap->all_photos($order_by, $sort_order, $page);
===
Retrieve author's/user's photos.
Note: You need to instantiate an httpclient object first
Arguments
Argument | Type | Opt/Required |
---|---|---|
$author_id |
int | Required |
$page |
int | Opt (Default: 1) |
Example
$stocksnap = new Diza\Stocksnap\HttpClient();
$photos = $stocksnap->author_photos($author_id, $page);
===
Retrieve photos for a search term.
Note: You need to instantiate an httpclient object first
Arguments
Argument | Type | Opt/Required | Note |
---|---|---|---|
$terms |
string | Required | Search terms (separated by + ) |
$order_by |
string | Opt (Default: relevance) | Accepted values: relevance , date , trending , views , downloads , favorites
|
$sort_order |
string | Opt (Default: desc) | Accepted values: asc , desc
|
$page |
int | Opt (Default: 1) |
Example
$stocksnap = new Diza\Stocksnap\HttpClient();
$photos = $stocksnap->search($terms, $order_by, $sort_order, $page);