{"id":21564613,"url":"https://github.com/amineo/ex_urlbox","last_synced_at":"2025-07-26T04:05:10.818Z","repository":{"id":40399894,"uuid":"488007093","full_name":"amineo/ex_urlbox","owner":"amineo","description":"A light wrapper for the Urlbox API","archived":false,"fork":false,"pushed_at":"2022-05-10T23:28:45.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T11:45:45.622Z","etag":null,"topics":["elixir","urlbox","website-screenshot"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/ex_urlbox","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amineo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-02T22:20:20.000Z","updated_at":"2022-09-07T08:41:42.000Z","dependencies_parsed_at":"2022-08-09T19:20:43.658Z","dependency_job_id":null,"html_url":"https://github.com/amineo/ex_urlbox","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amineo%2Fex_urlbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amineo%2Fex_urlbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amineo%2Fex_urlbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amineo%2Fex_urlbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amineo","download_url":"https://codeload.github.com/amineo/ex_urlbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248224047,"owners_count":21068071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","urlbox","website-screenshot"],"created_at":"2024-11-24T10:16:33.788Z","updated_at":"2025-07-26T04:05:10.784Z","avatar_url":"https://github.com/amineo.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExUrlbox\n[![Elixir Tests / Static Analysis](https://github.com/amineo/ex_urlbox/actions/workflows/elixir.yml/badge.svg?branch=main)](https://github.com/amineo/ex_urlbox/actions/workflows/elixir.yml)\n\n  A light wrapper for the Urlbox API written in Elixir. ExUrlbox's documentation could be found on [HexDocs](https://hexdocs.pm/ex_urlbox).\n\n  **Compatible with Urlbox API:** `v1`\n\n  A list of options that you can pass into `ExUrlbox.get/3`, `ExUrlbox.post/3`, `ExUrlbox.head/3`, and `ExUrlbox.delete/3` can be found here:\n  https://urlbox.io/docs/options\n\n\n## Installation\nThis package can be installed by adding `ex_urlbox` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_urlbox, \"~\u003e 0.3.0\"}\n  ]\nend\n```\n\n### Configure the Urlbox API Key and Secret\nYou can find your API Key and Secret [here](https://urlbox.io/dashboard/api).\n\n**Environment Vars (.env) -- refer to (.env.example)**\n```\nURLBOX_API_KEY=\"YoUrApIKeY\"\nURLBOX_API_SECRET=\"YoUrApISeCreT\"\n```\n\n**ExUrlbox will automatically look for the env vars listed above using the config below**\n```elixir\nconfig :ex_urlbox,\n  api_key: {:system, \"URLBOX_API_KEY\"},\n  api_secret: {:system, \"URLBOX_API_SECRET\"}\n```\n\n\n\n## Example Usage\n\n### GET - Synchronous\n  ```elixir\n  # Simple\n  ExUrlbox.get(\"https://anthonymineo.com\")\n\n  # With options:\n  ExUrlbox.get(\"https://anthonymineo.com\", [format: \"png\", full_page: true])\n\n  # With a timeout (5s):\n  ExUrlbox.get(\"https://anthonymineo.com\", [], 5_000)\n\n\n  # Extract data from a response\n  {:ok, screenshot} = ExUrlbox.get(\"https://anthonymineo.com\")\n\n  screenshot.body\n  # =\u003e \u003c\u003c137, 80, 78, 71, 13, ...\u003e\u003e\u003e\n\n  screenshot.headers\n  # =\u003e [{\"content-type\", \"image/png\"}, ...]\n\n  screenshot.url\n  # =\u003e https://api.urlbox.io/v1/:apikey/hmac(:apisecret)/png?url=https%3A%2F%2Fwww.google.com\u0026width=1024\u0026height=768\n\n  ```\n\n### POST - Async with a webhook\n  Post a request to Urlbox for a screenshot.\n  You should provide a `webhook_url` option to receive a postback to once the screenshot render is complete.\n  ```elixir\n  # Example request with options containing `webhook_url` for a postback:\n  ExUrlbox.post(\"https://anthonymineo.com\", [webhook_url: \"https://app-waiting-for-incoming-post.com/\"])\n  ```\n\n  **Initial response from a post:**\n  ```json\n  {\n    \"renderId\": \"ebcbce5q-9657-435f-aeb6-5db207ee87b5\",\n    \"status\": \"created\",\n    \"statusUrl\": \"https://api.urlbox.io/render/ebcbce5q-9657-435f-aeb6-5db207ee87b5\"\n  }\n```\n\n**Example postback to `webhook_url`:**\n```json\n{\n  \"event\": \"render.succeeded\",\n  \"renderId\": \"ebcbce5q-9657-435f-aeb6-5db207ee87b5\",\n  \"result\": {\n    \"renderUrl\": \"https://renders.urlbox.io/urlbox1/renders/a1d7g7d45f7am5a0a69cd3de/2022/5/7/ebcbce5q-9657-435f-aeb6-5db207ee87b5.png\",\n    \"size\": 34748\n  },\n  \"meta\": {\n    \"startTime\":\"2022-05-07T20:25:28.879Z\",\n    \"endTime\":\"2022-05-07T20:25:31.646Z\"\n  }\n}\n```\n\n\n**NOTE: If you dont provide a `webhook_url` you will need to poll the `statusUrl` that's included in the initial post response for the status of your request:**\n```json\n/* GET =\u003e statusUrl */\n{\n  \"renderId\": \"ebcbce5q-9657-435f-aeb6-5db207ee87b5\",\n  \"status\":\t\"succeeded\",\n  \"renderUrl\": \"https://renders.urlbox.io/urlbox1/renders/a1d7g7d45f7am5a0a69cd3de/2022/5/7/ebcbce5q-9657-435f-aeb6-5db207ee87b5.png\",\n  \"size\": 34748\n}\n```\n\n### DELETE\nUrlbox will cache previously created screenshots for some time. Sending a delete request removes a previously created screenshot from the cache.\n\n**Example request:**\n```elixir\nExUrlbox.delete(\"https://anthonymineo.com\")\n```\n\n### HEAD\nIf you just want to get the response status/headers without pulling down the full response body.\n\n**Example request:**\n```elixir\nExUrlbox.head(\"https://anthonymineo.com\")\n```\n\n\n\n\n\n\n## Docs\nThe full docs can be found at [https://hexdocs.pm/ex_urlbox](https://hexdocs.pm/ex_urlbox).\n\nDocumentation has been generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famineo%2Fex_urlbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famineo%2Fex_urlbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famineo%2Fex_urlbox/lists"}