GoRTB is a Go implementation of the OpenRTB (Real-Time Bidding) 2.5 specification. This library provides a robust and type-safe way to work with OpenRTB requests and responses in your Go applications.
GoRTB supports Go versions 1.13 and later.
- Full implementation of OpenRTB 2.5 specification
- Type-safe bid request and response handling
- Easy-to-use API for both bidders and exchanges
- Comprehensive validation of RTB objects
- High performance JSON serialization/deserialization
- Extensible architecture for custom implementations
To install GoRTB, use go get
:
go get github.com/MehrazRumman/gortb
Here's a simple example of how to create a bid request:
package main
import (
"fmt"
"github.com/MehrazRumman/gortb"
)
func main() {
// Create a new bid request
bidRequest := &gortb.BidRequest{
ID: "bid-req-1",
Imp: []gortb.Impression{{
ID: "imp-1",
Banner: &gortb.Banner{
W: 300,
H: 250,
},
}},
}
// Convert to JSON
json, err := bidRequest.Marshal()
if err != nil {
panic(err)
}
fmt.Printf("Bid Request: %s\n", string(json))
}
For detailed documentation and examples, please visit our Go Package Documentation.
BidRequest
: Represents an OpenRTB bid requestBidResponse
: Represents an OpenRTB bid responseImpression
: Describes an ad impression opportunityBid
: Contains bid information- Various objects for different ad types (Banner, Video, Native, etc.)
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please file an issue on the GitHub issue tracker.
- OpenRTB 2.5 Specification
- The Go community for their valuable feedback and contributions
Current version: v1.0.0