{"id":26457493,"url":"https://github.com/prebid/openrtb","last_synced_at":"2025-05-07T21:57:18.048Z","repository":{"id":60404061,"uuid":"89165980","full_name":"prebid/openrtb","owner":"prebid","description":"Go (Golang) OpenRTB 2.x, 3.0 / AdCOM 1.0 / Native 1.2 types/enums","archived":false,"fork":false,"pushed_at":"2024-12-12T20:56:46.000Z","size":533,"stargazers_count":59,"open_issues_count":2,"forks_count":30,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-05-07T21:57:10.593Z","etag":null,"topics":["adcom","go","golang","native","openrtb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mxmCherry/openrtb","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prebid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-23T19:14:24.000Z","updated_at":"2025-04-27T01:25:29.000Z","dependencies_parsed_at":"2024-04-17T17:35:44.229Z","dependency_job_id":"01d225e3-c86a-4a97-9cd1-2dfa8199a458","html_url":"https://github.com/prebid/openrtb","commit_stats":{"total_commits":259,"total_committers":15,"mean_commits":"17.266666666666666","dds":0.4054054054054054,"last_synced_commit":"49cfc483bdae8ff2e1c686180ada7f8de994faea"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prebid%2Fopenrtb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prebid%2Fopenrtb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prebid%2Fopenrtb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prebid%2Fopenrtb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prebid","download_url":"https://codeload.github.com/prebid/openrtb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961817,"owners_count":21832193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adcom","go","golang","native","openrtb"],"created_at":"2025-03-18T23:00:49.324Z","updated_at":"2025-05-07T21:57:18.011Z","avatar_url":"https://github.com/prebid.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# openrtb [![Go Reference](https://pkg.go.dev/badge/github.com/prebid/openrtb/v20.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v20) [![Test](https://github.com/prebid/openrtb/actions/workflows/test.yml/badge.svg)](https://github.com/prebid/openrtb/actions/workflows/test.yml)\n\n[OpenRTB](https://iabtechlab.com/standards/openrtb/), [AdCOM](https://iabtechlab.com/standards/openmedia) and [OpenRTB Dynamic Native Ads](https://iabtechlab.com/standards/openrtb-native/) types for [Go programming language](https://golang.org/)\n\n- [openrtb2](openrtb2/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf), [2.6](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md)\n- [openrtb3](openrtb3/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [3.0](https://github.com/InteractiveAdvertisingBureau/openrtb) (can lag behind because official spec is constantly updated without version bump, feel free to PR)\n- [adcom1](adcom1/) - [AdCOM](https://iabtechlab.com/standards/openmedia/) [1.0](https://github.com/InteractiveAdvertisingBureau/AdCOM) (can lag behind because official spec is constantly updated without version bump, feel free to PR)\n- [native1](native1/) - [OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf)\n\n**Requires Go 1.16+**\n\nThis library uses [Go modules](https://golang.org/ref/mod) ([tl;dr](https://blog.golang.org/using-go-modules)) and requires Go [1.16](https://golang.org/doc/go1.16)+ for the ability to issue release retractions.\n\n# Using\n\n```bash\ngo get -u \"github.com/prebid/openrtb/v20/...\"\n```\n\n```go\nimport (\n\topenrtb2 \"github.com/prebid/openrtb/v20/openrtb2\"\n\n\topenrtb3 \"github.com/prebid/openrtb/v20/openrtb3\"\n\tadcom1 \"github.com/prebid/openrtb/v20/adcom1\"\n\n\tnative1 \"github.com/prebid/openrtb/v20/native1\"\n\tnreq \"github.com/prebid/openrtb/v20/native1/request\"\n\tnres \"github.com/prebid/openrtb/v20/native1/response\"\n)\n```\n\nThis repo follows [semver](http://semver.org/) - see [releases](https://github.com/prebid/openrtb/releases).\nThe `main` branch always contains latest code, so better use some package manager to vendor specific version.\n\n# Guidelines\n\n## Naming convention\n- [UpperCamelCase](http://en.wikipedia.org/wiki/CamelCase)\n- Capitalized abbreviations (e.g., `AT`, `COPPA`, `PMP` etc.)\n- Capitalized `ID` keys\n- Enum items with versions should include minor/patch zeros, i.e. \"Foo 1.0\" -\u003e `Foo10` (and not just `Foo1`), \"Foo 1.1\" -\u003e `Foo11` etc\n\n## Types\n- Key types should be chosen according to OpenRTB specification (attribute types)\n- Numeric types:\n\t- `int8` - short enums (with values \u003c= 127), boolean-like attributes (like `BidRequest.test`)\n\t- `int64` - other integral types\n\t- `float64` - coordinates, prices etc.\n- Enums:\n\t- all enums, described in section 5, must be typed with section name singularized (e.g., \"5.2 Banner Ad Types\" -\u003e `type BannerAdType int8`)\n\t- all typed enums must have constants for each element, prefixed with type name (e.g., \"5.2 Banner Ad Types - XHTML Text Ad (usually mobile)\" -\u003e `const BannerAdTypeXHTMLTextAd BannerAdType = 1`)\n\t- never use `iota` for enum constants\n\t- OpenRTB (2.x) \"content categories\" should remain untyped and have no constants\n\n## Pointers/omitempty\nPointer | Omitempty | When to use                                                          | Example\n------- | --------- | -------------------------------------------------------------------- | ---------------------------------\n no     | no        | _required_ in spec                                                   | `Audio.MIMEs`\n yes    | yes       | _required_ in spec, but is a part of mutually-exclusive group        | `Imp.{Banner,Video,Audio,Native}`\n no     | yes       | zero value (`\"\"`, `0`) has no meaning, is defined in the spec as the default value, or represents time / duration                    | `Device.UA`\n yes    | yes       | zero value (`\"\"`, `0`) or value absence (`null`) has special meaning | `Device.{DNT,Lmt}`\n\nUsing both pointer and `omitempty` is mostly just to save traffic / generate more \"canonical\" (strict) JSON.\n\n## Documentation ([pkg.go.dev](https://pkg.go.dev/github.com/prebid/openrtb/v20))\n- [Godoc: documenting Go code](http://blog.golang.org/godoc-documenting-go-code)\n- Each entity (type, struct key or constant) should be documented\n- Ideally, copy-paste descriptions as-is, but feel free to omit section numbers, so just `\u003cGoTypeName\u003e defines \u003ccopy-pasted description from spec\u003e`\n\n## Code organization\n- Each RTB type should be kept in its own file, named after type\n- File names are in underscore_case, e.g., `type BidRequest` should be declared in `bid_request.go`\n- [go fmt your code](https://blog.golang.org/go-fmt-your-code)\n- [EditorConfig](https://editorconfig.org/) (not required, but useful)\n\n## Acknowledgments\nThis library was originally developed by [mxmCherry](https://github.com/mxmCherry) under The Unlicense license, still available at https://github.com/mxmCherry/openrtb but no longer maintained. Prebid.org's efforts to continue development are offered under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprebid%2Fopenrtb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprebid%2Fopenrtb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprebid%2Fopenrtb/lists"}