# `Fred.Client`
[🔗](https://github.com/akoutmos/fred/blob/master/lib/fred/client.ex#L1)

Low-level HTTP client for the FRED API using Req.

Handles request construction, parameter serialization, response parsing,
and telemetry instrumentation.

All endpoint modules delegate to this module for actual HTTP calls.

## Telemetry

Every request is wrapped in a `[:fred, :request]` telemetry span.
See `Fred.Telemetry` for event names, measurements, and metadata.

# `response`

```elixir
@type response() :: {:ok, map()} | {:error, Fred.Error.t()}
```

# `get_json`

```elixir
@spec get_json(endpoint :: String.t(), params :: keyword()) :: response()
```

Makes a GET request to the provided FRED API endpoint.

Automatically injects the API key, sets `file_type=json`, and emits
telemetry events around the request. `params` should contain the query
parameters required for the endpoint.

# `get_map_json`

```elixir
@spec get_map_json(endpoint :: String.t(), params :: keyword()) :: response()
```

Makes a GET request to the provided FRED Maps API endpoint. Used internally
by `Fred.Maps` for the GeoFRED base URL. `params` should contain the query
parameters required for the endpoint.

# `get_map_raw`

```elixir
@spec get_map_raw(endpoint :: String.t(), params :: keyword()) :: response()
```

Makes a GET request to the provided FRED Maps API endpoint. Used internally
by `Fred.Maps` to get shape files versus JSON.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
