> [!WARNING]
> [Zyte API](../../zyte-api/get-started.md#zyte-api) is replacing Smart Proxy Manager. It is
> no longer possible to sign up to Smart Proxy Manager. If you are an
> existing Smart Proxy Manager user, see spm-migrate.

# Using Smart Proxy Manager with R

> [!WARNING]
> For the code below to work you must first [install the Zyte
> CA certificate](../../misc/ca.md#ca).

> [!NOTE]
> All the code in this documentation has been tested with R 4.1.2.

1. Install [R](https://cran.r-project.org/) and follow
   [Fetching HTTPS pages with Zyte Smart Proxy Manager](../next-steps/fetching-https-pages-with-smart-proxy.md#fetching-https-pages-with-smart-proxy) to request URLs with `https`.
2. Run R on the terminal using `R` command.
3. Install httr library by running `install.packages("httr")` inside R prompt. If there’s an
   error saying `Library not loaded: /opt/X11/lib/libSM.6.dylib` run
   `system("locate libSM.6.dylib")`.
4. Load `httr` library by running `library(httr)` inside R prompt.
5. Run the sample code mentioned below inside R prompt after replacing `<SPM-APIKEY>` with Zyte
   Smart Proxy Manager API Key.

```r
GET("http://toscrape.com", use_proxy(url = "proxy.zyte.com", port = 8011, username = "<SPM-APIKEY>", password = ""))
```
