https://github.com/boudra/zuck
Facebook Graph API wrapper for Elixir
https://github.com/boudra/zuck
elixir facebook facebook-ads facebook-api facebook-graph-api
Last synced: about 1 month ago
JSON representation
Facebook Graph API wrapper for Elixir
- Host: GitHub
- URL: https://github.com/boudra/zuck
- Owner: boudra
- License: mit
- Created: 2017-04-24T20:06:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-20T20:11:35.000Z (about 2 years ago)
- Last Synced: 2025-04-20T17:38:12.180Z (2 months ago)
- Topics: elixir, facebook, facebook-ads, facebook-api, facebook-graph-api
- Language: Elixir
- Homepage:
- Size: 11.7 KB
- Stars: 14
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Zuck
## Installation
The package can be installed
by adding `zuck` to your list of dependencies in `mix.exs`:```elixir
def deps do
[{:zuck, git: "https://github.com/boudra/zuck.git"}}]
end
```## Configuration
```elixir
config :zuck,
app_id: "",
app_secret: "",
log: true,
debug: true,
version: "v2.9",
endpoint: "https://graph.facebook.com/",
http: [] # these will be passed to hackney
```## Roadmap
* [ ] Batch requests
* [ ] Real time updates
* [ ] Facebook messenger## Usage
### Basic example
```elixir
{:ok, user} = Zuck.get("/me", %{
access_token: "TOKEN",
fields: "name,email"
})
```### Pagination trough streams
You can use the stream helpers to handle multipage data, very useful when getting ad insights or large lists of data, the stream will handle the cursor and make the necesary requests for you:
```elixir
Zuck.get_stream("/act_ACCOUNT_ID/insights", %{
access_token: "TOKEN",
level: "ad",
date_preset: "yesterday",
fields: "ad_name"
})
|> Enum.map(fn ad -> ad.ad_name end)
```Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/zuck](https://hexdocs.pm/zuck).