When you add an API to the Apigee API Platform, you configure an API proxy for one or more existing services. Under the hood, the API Platform generates a new API, with its own unique network address and a processing pipeline that handles request and response messages. The API is exposed over the Internet and can be invoked over HTTP by client apps.
The API created can be as simple or as detailed as you like. An API can be a simple 'passthrough', exposing a single API method and funneling any type of request to a particular backend service. It can also be extremely granular, specifying responses based on the HTTP verb of the request, the URI requested, the content of the request or response, and so on.
Add the Yahoo Weather API
In this tutorial, you will create a proxy for the Yahoo Weather API. The Yahoo Weather API returns XML-formatted weather reports based on an identifier called a WOEID (where on Earth ID). The WOEID for Palo Alto, CA is 12797282. You can call this API directly. In a Web browser, enter:
http://weather.yahooapis.com/forecastrss?w=12797282
The result is an XML-formatted weather report.
Now you will go through the steps required to send the same request, and receive the same response, via an API proxy on the API Platform.
You must first add the Yahoo Weather API:
- Login to enterprise.apigee.com. (You can obtain a free account at enterprise.apigee.com/signup.)
- In the API Platform UI, select the APIs tab.

- Click the add (+) API button.

- Enter WeatherAPI for the Display Name.
- Enter Yahoo weather proxy as the description.

- Enter
/v1/weatheras the API Proxy URL.
API Proxy URL defines the proxy URL that apps call to invoke your API. The API Platform uses the proxy URL to match and route incoming request messages to the proper API proxy. The base of the API URL is automatically generated based on your organization and environment.
Your organization is typically synonymous with the API project name you provided when you signed up for an Apigee account. Although you can join more than one organization, most users will have an account in only one orgnization. An environment provides a runtime execution context for APIs. By default, Apigee organizations are provisioned with two environments: 'test' and 'prod'.
For example, if your account is in the organization calledapifactory, and your API is configured in the environmenttest, then the URL that you share with developers would be:http://apifactory-test.apigee.net/v1/weather.
- Enter
http://weather.yahooapis.comas the Backend Service URL.
Backend Service URL defines the target URL that the API Platform invokes on behalf of apps. You can add any URL that is accessible over the open Internet.
Now you're ready to define your first resource. Defining API resources is completely optional. In steps 5 and 6 you configured everything you need to manage the Yahoo Weather API.
By defining API resources, you gain more granular visibility and control over the API. An API resource is a URI. By defining specific resources, you gain the ability to apply policies to specific URIs, as well as operational visibility into the performance or consumption of those URIs. You can even further refine resource definitions by specifying the HTTP verb used against the URI. In this example, you define a resource that represents a weather forecast, along with the verb GET.
- In the Resources section, click the Verb menu and choose GET.
- Enter
/forecastrssas the Resource Path. By defining this URI, you can monitor and manage it specifically. - Enter Forecast for the Display Name.
- Enter Weather forecasts in the Description field.
- Click Done in the bottom right corner of the page.
The API platform generates and deploys a set of configuration files that govern the behavior of the processing pipeline for this API proxy as Revision 1. Your new API is automatically deployed into your test environment and listed in the API summary page.
Call Yahoo Weather API via the API
Now that you have a proxy for the Yahoo Weather API you can invoke it indirectly, via the API Platform.
In your Web browser, enter the following, substituting your Apigee organization name for {org_name}.
http://{org-name}-test.apigee.net/v1/weather/forecastrss?w=12797282
Look for the following content in the response:
<title>Yahoo! Weather - Palo Alto, CA</title> <link>http://us.rd.yahoo.com/dailynews/rss/weather/Palo_Alto__CA/*http://weather.yahoo.com/forecast/USCA1093_f.html</link> <description>Yahoo! Weather for Palo Alto, CA</description> <language>en-us</language>
You have added an API to the Apigee API Platform. You now have the ability modify the characteristics and behavior of the Yahoo Weather API. In the next step you'll add policies to configure your new API.