https://github.com/bsm/openrtb
OpenRTB protocol defintions for Go
https://github.com/bsm/openrtb
adtech go openrtb rtb
Last synced: 3 months ago
JSON representation
OpenRTB protocol defintions for Go
- Host: GitHub
- URL: https://github.com/bsm/openrtb
- Owner: bsm
- License: other
- Created: 2013-10-18T16:17:58.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2024-08-09T12:17:53.000Z (11 months ago)
- Last Synced: 2025-03-28T08:06:01.612Z (3 months ago)
- Topics: adtech, go, openrtb, rtb
- Language: Go
- Homepage:
- Size: 227 KB
- Stars: 292
- Watchers: 23
- Forks: 120
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rtb - openrtb by BSM - Go-lang BidRequest and BidResponse serialization without targeting or budget logic. ✊ (Table of Contents / Applications Engines and Frameworks)
README
# OpenRTB
[](https://travis-ci.org/bsm/openrtb)
OpenRTB structs and validations for Go.
## Requirements
Requires Go 1.8+ for proper `json.RawMessage` marshaling.
## Installation
To install, use `go get`:
```shell
go get github.com/bsm/openrtb/v3
```## Usage
```go
package mainimport (
"log"
"github.com/bsm/openrtb/v3"
)func main() {
file, err := os.Open("stored.json")
if err != nil {
log.Fatal(err)
}
defer file.Close()var req *openrtb.BidRequest
if err := json.NewDecoder(file).Decode(&req); err != nil {
log.Fatal(err)
}log.Printf("%+v\n", req)
}
```