Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Fixed API rate limiting error
Browse files Browse the repository at this point in the history
This closes #78 and #79
  • Loading branch information
vinkla committed Jun 12, 2018
1 parent 0a94032 commit f95e6e3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 9.0.1 (released 2018-06-12)

- Fixed API rate limiting error

## 9.0.0 (released 2018-06-01)

- Added user information endpoint
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ $instagram->self();

> **Note:** You can only fetch a user's recent media from the given access token.
## Rate Limiting

The Instagram allows you to call their API 200 times per hour. Try to cache the responses in your application.

> _The Instagram API uses the same rate limiting as the Graph API (200 calls per user per hour) with one exception: the /media/comments edge limits writes to 60 writes per user per hour. Please refer to the Graph API's rate limiting documentation for more information_ - [Facebook](https://developers.facebook.com/docs/instagram-api/overview/#rate-limiting)
## License

[MIT](LICENSE) © [Vincent Klaiber](https://vinkla.com)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"extra": {
"branch-alias": {
"dev-develop": "9.0-dev"
"dev-develop": "9.1-dev"
}
},
"minimum-stability": "dev",
Expand Down
4 changes: 4 additions & 0 deletions src/Instagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ protected function get(string $path): object

$body = json_decode((string) $response->getBody());

if (isset($body->error_message)) {
throw new InstagramException($body->error_message);
}

if (isset($body->meta->error_message)) {
throw new InstagramException($body->meta->error_message);
}
Expand Down

0 comments on commit f95e6e3

Please sign in to comment.