I'm not sure if this is what you need, but here is a simple extension that allows you to get the product url.
The main idea is to rewrite the info
method in the product api model and make it return the url of the product also.
For this you will need the following files:
app/etc/modules/[Namespace]_[Module].xml
- the declaration file
<?xml version="1.0"?>
<config>
<modules>
<[Namespace]_[Module]>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Catalog />
<Mage_Api />
</depends>
</[Namespace]_[Module]>
</modules>
</config>
app/code/local/[Namespace]/[Module]/etc/config.xml
- the configuration file
<?xml version="1.0"?>
<config>
<modules>
<[Namespace]_[Module]>
<version>0.0.1</version>
</[Namespace]_[Module]>
</modules>
<global>
<models>
<catalog>
<rewrite>
<product_api>[Namespace]_[Module]_Model_Product_Api</product_api>
</rewrite>
</catalog>
</models>
</global>
</config>
app/code/local/[Namespace]/[Module]/Model/Product/Api.php
- your new class
<?php
class [Namespace]_[Module]_Model_Product_Api extends Mage_Catalog_Model_Product_Api {
public function info($productId, $store = null, $attributes = null, $identifierType = null){
$product = $this->_getProduct($productId, $store, $identifierType);
$result = parent::info($productId, $store = null, $attributes = null, $identifierType = null);
//add a new element in here called product_url. You can even wrap it in some condition to see if the product is assigned to the current website or if the product is enabled or visible. ($product->getWebsiteIds(), $product->getStatus(), $product->getVisibility()).
$result['product_url'] = $product->getUrlInStore($store);
return $result;
}
}
Note: This works only for API V1. In order to make it work for v2 you need to add a wsdl to your module. See how you can do it.