Get Started

Developers can use the DFP API to build applications that manage inventory, create orders, pull reports, and more.

The DFP API uses SOAP; to help you get started, we offer client libraries for Java, .NET, Python, PHP, and Ruby.
To make your first API request, follow the steps below.
Users migrating from the AdX Seller REST API can
read the migration guide after making your first API request.

Get access to a DFP network

If you don't already have one, sign up for a DFP account.
You can also create a test network if you want to test the API in a separate environment.

Make a note of your network code. You'll find this in the URL when you are logged into your network. For example, in the URL https://www.google.com/dfp/2032576#delivery, 2032576 is your network code.
By using the DFP API you agree to the Terms of Service.

Create authentication credentials

You must authenticate all DFP API requests using OAuth2. The steps below cover the simple use case of accessing your own DFP data.
For more details and other options, see Authentication.

Python

Here is a basic example that shows how to use the
Python client library. The Python
Client Library supports Python
v2.7 or Python v3.0+ via the 2to3
converter. For more detailed usage information, refer to
the README
file in the client library distribution.

Run some code and make a request!
This example code must be run from the command line, not a browser.
The file containing this code must reside in the root of the project directory,
where composer require was run.

If you don't want to set your credentials in your App.config, then refer
to this wiki article
for alternate ways of using the DfpUser class. For more detailed information about using the .NET Client Library, refer
to the README
. If you want to develop in .NET without the client library, please refer to the
NoClientLibrary
wiki article.

Ruby

Here is a basic example that shows how to use the Ruby client library. The Ruby client library requires Ruby 2.1 or later.

If you encounter an error such as "cannot load such file -- mkmf (LoadError)" at any point while installing your gems, you may need to install additional Ruby development libraries such as ruby-dev, ruby-devel, xcode-select etc. for your particular environment.