code: func (c *Client) GetStats(i *GetStatsInput) (*StatsResponse, error) {
  
  	p := "/stats"
  
  	if i.Service != "" {
  		p = fmt.Sprintf("%s/service/%s", p, i.Service)
  	}
  
  	if i.Field != "" {
  		p = fmt.Sprintf("%s/field/%s", p, i.Field)
  	}
  
  	r, err := c.Get(p, &RequestOptions{
  		Params: map[string]string{
  			"from":   i.From,
  			"to":     i.To,
  			"by":     i.By,
  			"region": i.Region,
  		},
  	})
  	if err != nil {
  		return nil, err
  	}
  
  	var sr *StatsResponse
  	if err := decodeJSON(&sr, r.Body); err != nil {
  		return nil, err
  	}
  
  	return sr, nil
  }
docs: // GetStats returns stats data based on GetStatsInput