Skip to content

Commit 1629858

Browse files
authored
Merge pull request #14 from frenchcomp/fix/sirene-api
Fix the new sirene api url
2 parents 7e4c38a + a88edff commit 1629858

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Sirene.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Sirene
2020
/**
2121
* @var string $urlApi the url of API sirene
2222
*/
23-
private string $urlApi = "https://api.insee.fr/entreprises/sirene/V3.11";
23+
private string $urlApi = "https://api.insee.fr/api-sirene/3.11";
2424

2525
/**
2626
* @var string $apiKey the api key of your sirene application
@@ -30,9 +30,18 @@ class Sirene
3030
/**
3131
* @param string $key api sirene key of your application
3232
*/
33-
public function __construct(string $key)
33+
public function __construct(string $key, ?string $urlApi = null)
3434
{
3535
$this->apiKey = $key;
36+
37+
if (null !== $urlApi) {
38+
$this->urlApi = $urlApi;
39+
}
40+
}
41+
42+
public function setApiUrl(string $url): void
43+
{
44+
$this->urlApi = $url;
3645
}
3746

3847
/**

0 commit comments

Comments
 (0)